diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-02-11 15:37:05 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-02-11 15:37:05 -0800 |
commit | ca938c0fc90d28032005356b019db0d04b5439ee (patch) | |
tree | f4b5cba3ab694c26ca76146578ec7e2f05c6965e /activerecord | |
parent | 77a6e2558475b80481739c091a873bf39f46cf3b (diff) | |
download | rails-ca938c0fc90d28032005356b019db0d04b5439ee.tar.gz rails-ca938c0fc90d28032005356b019db0d04b5439ee.tar.bz2 rails-ca938c0fc90d28032005356b019db0d04b5439ee.zip |
fixing variable names
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/fixtures.rb | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb index aa8a746d52..34f27a107f 100644 --- a/activerecord/lib/active_record/fixtures.rb +++ b/activerecord/lib/active_record/fixtures.rb @@ -509,14 +509,20 @@ class Fixtures table_names.each { |n| class_names[n.tr('/', '_').to_sym] = n.classify if n.include?('/') } connection = block_given? ? yield : ActiveRecord::Base.connection - table_names_to_fetch = table_names.reject { |table_name| fixture_is_cached?(connection, table_name) } + files_to_read = table_names.reject { |table_name| fixture_is_cached?(connection, table_name) } - unless table_names_to_fetch.empty? + unless files_to_read.empty? connection.disable_referential_integrity do fixtures_map = {} - fixtures = table_names_to_fetch.map do |table_name| - fixtures_map[table_name] = Fixtures.new(connection, table_name.tr('/', '_'), class_names[table_name.tr('/', '_').to_sym], File.join(fixtures_directory, table_name)) + fixtures = files_to_read.map do |path| + table_name = path.tr '/', '_' + + fixtures_map[path] = Fixtures.new( + connection, + table_name, + class_names[table_name.to_sym], + File.join(fixtures_directory, path)) end all_loaded_fixtures.update(fixtures_map) |