diff options
author | rick <technoweenie@gmail.com> | 2008-07-16 14:20:15 -0700 |
---|---|---|
committer | rick <technoweenie@gmail.com> | 2008-07-16 14:20:15 -0700 |
commit | 0a6d75dedd79407376aae1f01302164dfd3e44b6 (patch) | |
tree | dfef7e73b3b19a65895651c82cb6e0b727394eab /activerecord/lib/active_record/fixtures.rb | |
parent | a14cedc7797aef4ccd9da46ed73e36d730392814 (diff) | |
parent | fc89a951933638b051bb1f9e1339ee6ae7c94cda (diff) | |
download | rails-0a6d75dedd79407376aae1f01302164dfd3e44b6.tar.gz rails-0a6d75dedd79407376aae1f01302164dfd3e44b6.tar.bz2 rails-0a6d75dedd79407376aae1f01302164dfd3e44b6.zip |
merge with local tweaks
Diffstat (limited to 'activerecord/lib/active_record/fixtures.rb')
-rwxr-xr-x | activerecord/lib/active_record/fixtures.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb index e19614e31f..17fb9355c4 100755 --- a/activerecord/lib/active_record/fixtures.rb +++ b/activerecord/lib/active_record/fixtures.rb @@ -541,10 +541,11 @@ class Fixtures < (RUBY_VERSION < '1.9' ? YAML::Omap : Hash) label.to_s.hash.abs end - attr_reader :table_name + attr_reader :table_name, :name def initialize(connection, table_name, class_name, fixture_path, file_filter = DEFAULT_FILTER_RE) @connection, @table_name, @fixture_path, @file_filter = connection, table_name, fixture_path, file_filter + @name = table_name # preserve fixture base name @class_name = class_name || (ActiveRecord::Base.pluralize_table_names ? @table_name.singularize.camelize : @table_name.camelize) @table_name = "#{ActiveRecord::Base.table_name_prefix}#{@table_name}#{ActiveRecord::Base.table_name_suffix}" @@ -963,9 +964,9 @@ module Test #:nodoc: fixtures = Fixtures.create_fixtures(fixture_path, fixture_table_names, fixture_class_names) unless fixtures.nil? if fixtures.instance_of?(Fixtures) - @loaded_fixtures[fixtures.table_name] = fixtures + @loaded_fixtures[fixtures.name] = fixtures else - fixtures.each { |f| @loaded_fixtures[f.table_name] = f } + fixtures.each { |f| @loaded_fixtures[f.name] = f } end end end |