From 090f014c63ae3e36662cacf9a0bdd2d51cd0e6e6 Mon Sep 17 00:00:00 2001 From: Azul Date: Mon, 16 Dec 2013 18:14:49 +0100 Subject: Use Hash#delete_if as it returns the hash in all cases. Hash#reject! returns nil if nothing was rejected. But we always want the data from the file - no matter if it contained keys we remove or not. --- files/couch-doc-update | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/couch-doc-update b/files/couch-doc-update index 47b89a4..242ed14 100644 --- a/files/couch-doc-update +++ b/files/couch-doc-update @@ -83,7 +83,7 @@ end def read_file(filename) data = MultiJson.load( IO.read(filename) ) # strip off _id and _rev to avoid conflicts - data.reject! {|k,v| k.start_with? '_'} + data.delete_if {|k,v| k.start_with? '_'} end # -- cgit v1.2.3