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

This commit is contained in:
Jeremy Kemper
2008-08-23 21:26:14 -07:00
parent 2efdeb7a95
commit c471f13db6

View File

@@ -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