#203 ✓resolved
Yaroslaff Fedin

Namespaced models break associations

Reported by Yaroslaff Fedin | April 13th, 2008 @ 02:21 PM

Say, I have namespaced model `Forums::Topic`.

I define association like:

`has :posts, 0..n, :class_name => "Forums::Post".`

Then, if I try to do something like:

`Forums::Topic.first.posts`

I get:

`unitialized constant DataMapper::Support::Object::Post`

which is obviously a result of demodulizing the class name at line 14 of one_to_many.rb. If i fix that line to avoid demodulization, it breaks foreign_key guessing.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Referenced by

Pages