On 3/13/06, Francois Beausoleil <[EMAIL PROTECTED]> wrote: > http://dev.rubyonrails.org/changeset/3804 > > This test case fails in r3804 and later: > > class CategoriesControllerTest < Test::Unit::TestCase > fixtures :categories_screenshots > > def test_update > ... > end > end > > 11) Error: > test_update_accepts_screenshot(CategoriesControllerTest): > FixtureClassNotFound: The class "CategoriesScreenshot" was not found. > > D:/app/config/../vendor/rails/activerecord/lib/active_record/fixtures.rb:401:in > `find' > > D:/app/config/../vendor/rails/activerecord/lib/active_record/fixtures.rb:226:in > `instantiate_fixtures' > > D:/app/config/../vendor/rails/activerecord/lib/active_record/fixtures.rb:225:in > `each' > > D:/app/config/../vendor/rails/activerecord/lib/active_record/fixtures.rb:225:in > `instantiate_fixtures' > > D:/app/config/../vendor/rails/activerecord/lib/active_record/fixtures.rb:224:in > `silence' > > D:/app/config/../vendor/rails/activerecord/lib/active_record/fixtures.rb:224:in > `instantiate_fixtures' > > D:/app/config/../vendor/rails/activerecord/lib/active_record/fixtures.rb:587:in > `instantiate_fixtures' > > D:/app/config/../vendor/rails/activerecord/lib/active_record/fixtures.rb:586:in > `each' > > D:/app/config/../vendor/rails/activerecord/lib/active_record/fixtures.rb:586:in > `instantiate_fixtures' > > D:/app/config/../vendor/rails/activerecord/lib/active_record/fixtures.rb:523:in > `setup_with_fixtures' > > D:/app/config/../vendor/rails/activerecord/lib/active_record/fixtures.rb:545:in > `setup' > > D:/app/config/../vendor/rails/activerecord/lib/active_record/fixtures.rb:544:in > `setup' > > Note the class name was partially singularized. > > in r3803, Fixture simply returned a nil object on Fixture#find: > http://dev.rubyonrails.org/browser/trunk/activerecord/lib/active_record/fixtures.rb?rev=3803#L393 > > In r3804, the system is more robust because it raises an exception if > the class cannot be found: > http://dev.rubyonrails.org/browser/trunk/activerecord/lib/active_record/fixtures.rb?rev=3804#L396 > > I narrowed the problem down to lines 274-275 of Fixtures: > http://dev.rubyonrails.org/browser/trunk/activerecord/lib/active_record/fixtures.rb#L274 > > categories_screenshots is an habtm join table. There is no class of > that name, nor should there be. > > I am not sure how I should patch my way around this... Any help > appreciated. Can Inflector properly singularize such a beast ? > > Thanks ! > -- > François Beausoleil > http://blog.teksol.info/
What are you trying to do? If this is a habtm, there is no join model, so you shouldn't be calling categories_screenshots(:foo). If it is a join model that's named differently, then you need to set the proper fixture class: fixtures :categories_screenshots set_fixture_class :categories_screenshots => CategoryScreenshot If I recall, I wrote it so it *only* raises the exception if you try to call categories_screenshots(), which tries to load the model record. -- Rick Olson http://techno-weenie.net _______________________________________________ Rails-core mailing list Rails-core@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-core