diff options
author | Azul <azul@riseup.net> | 2013-12-16 18:14:49 +0100 |
---|---|---|
committer | Azul <azul@riseup.net> | 2013-12-16 18:17:32 +0100 |
commit | 090f014c63ae3e36662cacf9a0bdd2d51cd0e6e6 (patch) | |
tree | 784d04d1f3eba1c840cc834e5004243942afac8c | |
parent | 7ac2149cdc9f9ca0ce00f70c4e7ac48c896889ec (diff) |
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.
-rw-r--r-- | files/couch-doc-update | 2 |
1 files changed, 1 insertions, 1 deletions
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 # |