lib/rico/map.rb in rico-0.3.0 vs lib/rico/map.rb in rico-0.4.0
- old
+ new
@@ -27,18 +27,20 @@
obj
end
protected
+ def build_map_add(items)
+ { "_type" => type_key, "_values" => compute_add(items) }
+ end
+
def build_map_remove(items)
keys = extract_keys(items)
{ "_type" => type_key, "_values" => compute_remove(items), "_deletes" => keys }
end
def compute_add(items)
- Array(items).inject(members) do |res, h|
- res.merge(h)
- end
+ members.merge(items)
end
def compute_remove(items)
keys = extract_keys(items)
members.delete_if {|k,v| keys.include? k.to_s }