Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Ruby 1.9 compat: Hash is now flattenable, so explicitly exclude it

  • Loading branch information...
commit c471f13db63844fe290615ed6e1ddca32b26570d 1 parent 2efdeb7
@jeremy jeremy authored
View
2  activerecord/lib/active_record/associations/association_proxy.rb
@@ -213,7 +213,7 @@ def raise_on_type_mismatch(record)
# 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
Please sign in to comment.
Something went wrong with that request. Please try again.