
DataMapper Property not working with rails 3
Reported by Daniel Neighman (hassox) | May 20th, 2010 @ 02:27 AM | in 1.0.0
I just discovered the changes to the DataMapper types moving from DataMapper::Types to DataMapper::Property:: today when I updated my app to 1.0.0.rc2 This stopped my app from working at all :(
I've updated the types to use the new namespace, and made the
relevant methods instance methods. This kinda worked by in my
model
class Employment
include DataMapper::Resource
#snip
property :email, EmailString
#snip
end
This seems to load the first time I hit rails (3) but after that, it's not found. (constant not found and raises)
uninitialized constant Employment::EmailString
Sorry I can't provide more info on this one lads :(
Comments and changes to this ticket
-
Dan Kubb (dkubb) May 20th, 2010 @ 02:34 AM
- State changed from new to unconfirmed
-
Daniel Neighman (hassox) May 20th, 2010 @ 02:35 AM
Some more info lads.
I've required the files that have my types at the tops of each mode file.
When I change the property line to
property :email, DataMapper::Property::EmailString
it reloads as expected. The really strange thing is that I have the EmailString in my user model, and this has so far not blown up :\ (that may be because it hasn't been loaded yet though, dunno with rails loading)
-
Dan Kubb (dkubb) May 20th, 2010 @ 02:36 AM
- Tag set to regression
-
Piotr Solnica (solnic) May 20th, 2010 @ 03:59 AM
- Assigned user set to Piotr Solnica (solnic)
I'll look into that
-
Marcin Kulik May 20th, 2010 @ 07:11 AM
I had similar problem but not quite related to Property or DM in general. But it may be loosely related to this, who knows.
I have WebForm class in my models dir which is parent class for my non-db form models. It includes some ActiveModel stuff like Naming and Validations. I experience the same, on first request everything looks fine, but on next one I get some "ambiguous superclass WebForm" error. When I've moved WebForm and all it's subclassess from app/models to app/forms it started to work fine.
-
José Valim May 20th, 2010 @ 07:28 AM
Mate (@hassox), what does
User.ancestors
return in the first and in the second request? -
Piotr Solnica (solnic) May 21st, 2010 @ 09:32 AM
- State changed from unconfirmed to confirmed
- Assigned user cleared.
Looks like we still have issues with classes reloading in Rails3
-
Dan Kubb (dkubb) May 26th, 2010 @ 02:07 AM
- Milestone set to 1.0.0
-
Dan Kubb (dkubb) May 26th, 2010 @ 02:26 AM
- Assigned user set to Martin Gamsjaeger (snusnu)
-
Martin Gamsjaeger (snusnu) May 29th, 2010 @ 10:55 AM
- State changed from confirmed to resolved
DataMapper.finalize should have fixed that.
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.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »