
class loading errors when used with rails3 console
Reported by gucki | May 21st, 2010 @ 08:01 AM | in 1.0.0
Please see here for a simple example:
http://pastie.org/970780
Using these models inside rails server works without any problems.
Versions: dm 1.0.0.rc2, ruby 1.9.2-head, rails3.0.0b3.
Comments and changes to this ticket
-
Dan Kubb (dkubb) May 23rd, 2010 @ 08:53 PM
- State changed from new to unconfirmed
- Assigned user set to Martin Gamsjaeger (snusnu)
-
Dan Kubb (dkubb) May 26th, 2010 @ 02:04 AM
- Milestone set to 1.0.0
-
Martin Gamsjaeger (snusnu) June 3rd, 2010 @ 09:04 AM
- State changed from unconfirmed to resolved
The code you attached cannot work (although I do think that you know that and just slimmed it down - a bit too much). Anyway, I included what's necessary to make it work (totally rails unrelated), and it does work for me now.
class Team include DataMapper::Resource property :id, Serial has n, :memberships end class Team::Membership include DataMapper::Resource belongs_to :team, :key => true end
gives
Loading development environment (Rails 3.0.0.beta3) ree-1.8.7-2010.01 > Team.create => #<Team @id=2> ree-1.8.7-2010.01 > Team.first => #<Team @id=1> ree-1.8.7-2010.01 > Team.first.memberships => [] ree-1.8.7-2010.01 >
Marking this resolved
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 »