Archive for the ‘rails’ Category

NameError: uninitialized constant User::Registration

Sunday, February 14th, 2010

Problem with “Beginning Rails page 113:

I found a typo in the book too… it says:
Let’s generate the model and migration for the registration table now:
$ ./script/generate model registrations

it should say:
$ ./script/generate model registration

This causes problems later on when doing the following:
event = Event.find(:first)
user = create(:login => 'simon', :email => 'simon@example.com', :password => 'secret')
user.registrations.any?
NameError: uninitialized constant User::Registration

I had to figure that one out the hard way…