diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-08-23 21:26:14 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-08-23 21:26:14 -0700 |
commit | c471f13db63844fe290615ed6e1ddca32b26570d (patch) | |
tree | 7b90f6e92d318a2112091a2448e2c1d5507a4149 | |
parent | 2efdeb7a9517b677240e2c821c97941f6b905923 (diff) | |
download | rails-c471f13db63844fe290615ed6e1ddca32b26570d.tar.gz rails-c471f13db63844fe290615ed6e1ddca32b26570d.tar.bz2 rails-c471f13db63844fe290615ed6e1ddca32b26570d.zip |
Ruby 1.9 compat: Hash is now flattenable, so explicitly exclude it
-rw-r--r-- | activerecord/lib/active_record/associations/association_proxy.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/association_proxy.rb b/activerecord/lib/active_record/associations/association_proxy.rb index 981be3b1a9..99b8748a48 100644 --- a/activerecord/lib/active_record/associations/association_proxy.rb +++ b/activerecord/lib/active_record/associations/association_proxy.rb @@ -213,7 +213,7 @@ module ActiveRecord # Array#flatten has problems with recursive arrays. Going one level deeper solves the majority of the problems. def flatten_deeper(array) - array.collect { |element| element.respond_to?(:flatten) ? element.flatten : element }.flatten + array.collect { |element| (element.respond_to?(:flatten) && !element.is_a?(Hash)) ? element.flatten : element }.flatten end def owner_quoted_id |