lib/mongoid/criterion/selector.rb in mongoid-2.4.1 vs lib/mongoid/criterion/selector.rb in mongoid-2.4.2
- old
+ new
@@ -100,14 +100,12 @@
value.all?{ |e| e.is_a?(Hash) }
end
def handle_and_or_value(values)
[].tap do |result|
- values.map do |value|
- value.each do |key, value|
- result.push key => try_to_typecast(key, value)
- end
- end
+ result.push(*values.map do |value|
+ Hash[value.map{ |key, value| [key, try_to_typecast(key, value)] }]
+ end)
end
end
# Get the typecast value for the defined field.
#