diff options
-rwxr-xr-x | activerecord/lib/active_record/fixtures.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb index 7a00b5bb56..611365669d 100755 --- a/activerecord/lib/active_record/fixtures.rb +++ b/activerecord/lib/active_record/fixtures.rb @@ -438,7 +438,7 @@ end # # Any fixture labeled "DEFAULTS" is safely ignored. -class Fixtures < YAML::Omap +class Fixtures < (RUBY_VERSION < '1.9' ? YAML::Omap : Hash) DEFAULT_FILTER_RE = /\.ya?ml$/ @@all_cached_fixtures = {} @@ -467,7 +467,7 @@ class Fixtures < YAML::Omap end def self.cache_fixtures(connection, fixtures) - cache_for_connection(connection).update(fixtures.index_by(&:table_name)) + cache_for_connection(connection).update(fixtures.index_by { |f| f.table_name }) end def self.instantiate_fixtures(object, table_name, fixtures, load_instances = true) |