lib/eternity/patch.rb in eternity-0.1.0 vs lib/eternity/patch.rb in eternity-0.1.1
- old
+ new
@@ -58,9 +58,11 @@
hash[collection] = {}
elements.each do |id, change|
if change['action'] == UPDATE && current_index[collection][id].sha1 == Blob.digest(Blob.serialize(change['data']))
change = nil
+ elsif change['action'] == DELETE && !current_index[collection].include?(id)
+ change = nil
end
hash[collection][id] = change if change
end
hash.delete collection if hash[collection].empty?