Topic: cant load a specific fixture (messages.yml)

I have a fixture called messages that I try to load in my mygration using the following code:

f =, # a database connection
                     "messages", # table name
                     Message, # model class
                     File.join(File.dirname(__FILE__), "dev_data/messages"))

I used the same procedure for every other model/fixture and that one is the only one that doesnt work. I have looked to see if <messages> is a reserved keyword or something and didnt find anything.

The error I get when I run the migration is:

== CreateMessages: migrating ==================================================
-- create_table(:messages)
   -> 0.0046s
rake aborted!
uninitialized constant Message

Anyone can help? I use the Message model in a lot of place in my application so I hope I wont have to refactor everything with a  new name...

Thanks a lot!

Re: cant load a specific fixture (messages.yml)

Try running with trace enabled, it may give you more information.

rake db:migrate --trace

Re: cant load a specific fixture (messages.yml)

Thanks for the hint!

I noticed that I had given a bad name to the model, it was Messages insted of Message...

Long live Bender!

Re: cant load a specific fixture (messages.yml)

Ok.. it works when I load the fixture manually in the migration code but when I do: rake load_fixture it doesnt work and I get no error message. I tried to run it with --trace and there are no real usefull  information.

I have the problem with a few of my others fixture too, but not all... and they were all generated using data from the Dev environment.