Catch FixtureClassNotFound when using instantiated fixtures on a fixture that has no ActiveRecord model [Rick Olson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3866 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
796a43dead
commit
4965a754d5
|
@ -1,5 +1,7 @@
|
|||
*SVN*
|
||||
|
||||
* Catch FixtureClassNotFound when using instantiated fixtures on a fixture that has no ActiveRecord model [Rick Olson]
|
||||
|
||||
* Allow ordering of calculated results and/or grouped fields in calculations [solo@gatelys.com]
|
||||
|
||||
* Dynamically set allow_concurrency. #4044 [Stefan Kaes]
|
||||
|
|
|
@ -223,8 +223,10 @@ class Fixtures < YAML::Omap
|
|||
if load_instances
|
||||
ActiveRecord::Base.silence do
|
||||
fixtures.each do |name, fixture|
|
||||
if model = fixture.find
|
||||
object.instance_variable_set "@#{name}", model
|
||||
begin
|
||||
object.instance_variable_set "@#{name}", fixture.find
|
||||
rescue FixtureClassNotFound
|
||||
nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -11,7 +11,7 @@ class FixturesTest < Test::Unit::TestCase
|
|||
self.use_instantiated_fixtures = true
|
||||
self.use_transactional_fixtures = false
|
||||
|
||||
fixtures :topics, :developers, :accounts, :tasks, :categories
|
||||
fixtures :topics, :developers, :accounts, :tasks, :categories, :funny_jokes
|
||||
|
||||
FIXTURES = %w( accounts companies customers
|
||||
developers developers_projects entrants
|
||||
|
|
Loading…
Reference in New Issue