Skip to content


Don't bork input args #73

wants to merge 1 commit into from

2 participants



This should be a win-win, don't think it can be harmful.



hi, no interest here?


hey @banker hope you'll look at this


Yep. These have been added since you opened the request. Sorry this particular commit wasn't merged in.

@banker banker closed this

great thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
1  lib/mongo/collection.rb
@@ -168,6 +168,7 @@ def hint=(hint=nil)
# @core find find-instance_method
def find(selector={}, opts={})
+ opts = opts.dup # don't bork input args
fields = opts.delete(:fields)
fields = ["_id"] if fields && fields.empty?
skip = opts.delete(:skip) || skip || 0
1  lib/mongo/gridfs/grid_file_system.rb
@@ -93,6 +93,7 @@ def initialize(db, fs_name=Grid::DEFAULT_FS_NAME)
# @return [Mongo::GridIO]
def open(filename, mode, opts={})
+ opts = opts.dup # don't bork input args
del = opts.delete(:delete_old) && mode == 'w'
file =, @chunks, filename, mode, opts)
1  lib/mongo/gridfs/grid_io.rb
@@ -51,6 +51,7 @@ class GridIO
# @option opts [Boolean] :safe (false) When safe mode is enabled, the chunks sent to the server
# will be validated using an md5 hash. If validation fails, an exception will be raised.
def initialize(files, chunks, filename, mode, opts={})
+ opts = opts.dup # don't bork input args
@files = files
@chunks = chunks
@filename = filename
Something went wrong with that request. Please try again.