mirror of
https://github.com/github/rails.git
synced 2026-02-05 19:55:14 -05:00
Ruby 1.9 compat: Fixtures inherits Hash instead of YAML::Omap since it's now insertion-ordered. Work around a &:procname crash.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8480 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user