Hey all, I have a model called User with set_table_name People When I run rake test_units, the tests look for a table called users rather than people. Is this supposed to happen? I''m a bit confused, as I thought set_table_name would account for this. Anything else I can do? I''m using SQL Server for my database, if that helps. Thanks, Jin Lee _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Check that your fixture is named after the table name. It seems that when fixtures load, they try to insert into a table named after the fixture, regardless of what the model says. Cheers, Dan
Dan, Thanks for the reply. I can''t remember if my fixtures were named after the model or the db. I''ll have to check tomorrow when I get into work. Im curious though, which do you (and others) think is more "correct"? To have fixtures named after the model, or after the table name? Jin On 7/26/05, Dan Sketcher <dansketcher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Check that your fixture is named after the table name. It seems that > when fixtures load, they try to insert into a table named after the > fixture, regardless of what the model says. > > Cheers, > Dan >
On 7/27/05, Jin Lee <jinslee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Dan, > > Thanks for the reply. I can''t remember if my fixtures were named after > the model or the db. I''ll have to check tomorrow when I get into work. > > Im curious though, which do you (and others) think is more "correct"? > To have fixtures named after the model, or after the table name?The table name. Remember, the fixtures connect directly to the database, they don''t use ActiveRecord directly. If they did, how could you test custom accessors etc. -- Cheers Koz