lib/arel/visitors/sunstone_extensions.rb in arel-extensions-6.0.0.1 vs lib/arel/visitors/sunstone_extensions.rb in arel-extensions-6.0.0.4

- old
+ new

@@ -1,10 +1,18 @@ module Arel module Visitors class Sunstone private - + + def visit_Hash o, collector + value = {} + o.each do |key, value| + value[visit(key, collector)] = visit(value, collector) + end + value + end + def visit_Arel_Nodes_Contains o, collector key = visit(o.left, collector) value = { contains: visit(o.right, collector) } if key.is_a?(Hash) @@ -86,10 +94,10 @@ end end def visit_Arel_Nodes_HasAnyKey o, collector key = visit(o.left, collector) - value = {has_any_key: Array(o.right).map(&:to_s)} + value = { has_any_key: visit(Array(o.right), collector) } if key.is_a?(Hash) add_to_bottom_of_hash(key, value) else { key => value } \ No newline at end of file