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/
_______________________________________________
Rails-core mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-core