Skip to content
Browse files

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

  • Loading branch information...
1 parent 2efdeb7 commit c471f13db63844fe290615ed6e1ddca32b26570d @jeremy jeremy committed Aug 23, 2008
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/associations/association_proxy.rb
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

0 comments on commit c471f13

Please sign in to comment.
Something went wrong with that request. Please try again.