mirror of
https://github.com/github/rails.git
synced 2026-01-28 07:48:00 -05:00
give helpful error messages when fixtures accessed style table_name(:name) cannot be found [Tobias Luetke]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3480 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user