diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2007-02-25 19:27:56 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2007-02-25 19:27:56 +0000 |
commit | 23e24c5996c90e072b66a616ee0cbe066dd5c1a2 (patch) | |
tree | 5063868f1aa76dcc32487f69788a027a8ce5242a /activerecord | |
parent | 87b7b5b3e74cb6ce3efc7e472c933bf846b26cc3 (diff) | |
download | rails-23e24c5996c90e072b66a616ee0cbe066dd5c1a2.tar.gz rails-23e24c5996c90e072b66a616ee0cbe066dd5c1a2.tar.bz2 rails-23e24c5996c90e072b66a616ee0cbe066dd5c1a2.zip |
Setting fixtures automatically for integration tests is a bit harder -- will have to wait until the test superclass reform is implemented
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6228 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord')
-rwxr-xr-x | activerecord/lib/active_record/fixtures.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb index 92c4647819..2fe89aac16 100755 --- a/activerecord/lib/active_record/fixtures.rb +++ b/activerecord/lib/active_record/fixtures.rb @@ -490,10 +490,12 @@ module Test #:nodoc: def self.setup_fixture_accessors(table_names=nil) (table_names || fixture_table_names).each do |table_name| table_name = table_name.to_s.tr('.','_') + define_method(table_name) do |fixture, *optionals| force_reload = optionals.shift @fixture_cache[table_name] ||= Hash.new @fixture_cache[table_name][fixture] = nil if force_reload + if @loaded_fixtures[table_name][fixture.to_s] @fixture_cache[table_name][fixture] ||= @loaded_fixtures[table_name][fixture.to_s].find else |