diff options
Diffstat (limited to 'activerecord/lib')
-rwxr-xr-x | activerecord/lib/active_record/fixtures.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb index 2c3609aa77..3d2fa3ac71 100755 --- a/activerecord/lib/active_record/fixtures.rb +++ b/activerecord/lib/active_record/fixtures.rb @@ -453,7 +453,11 @@ module Test #:nodoc: force_reload = optionals.shift @fixture_cache[table_name] ||= Hash.new @fixture_cache[table_name][fixture] = nil if force_reload - @fixture_cache[table_name][fixture] ||= @loaded_fixtures[table_name][fixture.to_s].find + if @loaded_fixtures[table_name][fixture.to_s] + @fixture_cache[table_name][fixture] ||= @loaded_fixtures[table_name][fixture.to_s].find + else + raise StandardError, "No fixture with name '#{fixture}' found for table '#{table_name}'" + end end end end |