On 21 February 2010 12:44, Hemant Bhargava <[email protected]> wrote: > Hemant Bhargava wrote: >> Ok fine colin.. somehow i managed to get rid of this.. I'll you how i >> had done this.. >> >> For time being can you please tell me that how to specify the plural >> names? > > Hello dude .. Thanks a lot to you .. > Anywayz i have resolved it. the only problem wat that i was giving > fixtures :all in test_helper.. I still think that there is no problem > writing that line in test_helper.. but i just removed that line from > there and it worked like a charm .. :)
I guess you have merely delayed the problem here by avoiding attempting to load the fixture for the problematic model. When you come to test the leave model the problem will re-appear. As I said before it is important to get the names correct. The model class name should be singular (class Thing < ActiveRecord::Base in thing.rb), the unit test also singular (ThingTest in thing_test.rb) and the fixtures file plural (things.yml). To check what rails thinks are the singular and the plural of words run script/console so for example col...@piglet:~/websites/weather$ script/console Loading development environment (Rails 2.3.4) >> "leaves".singularize => "leafe" >> "leafe".pluralize => "leaves" >> "leaf".pluralize => "leafs" I must admit that leafe looks wrong to me, I am not sure that it even a word. I would have expected the singular of leaves to be leave or leaf (in UK English at least). This may even be a bug. It is possible to override the builtin rules for your model names if you wish but it is generally simpler to avoid this unless you really have to. Google will tell you how if you feel the need. Colin > > Cheers .. > >> I mean i have a fixture file leaves.yml and by default error is coming >> that no file to load - leafe.. >> > -- > Posted via http://www.ruby-forum.com/. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

