Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Don't bork input args #73

Closed
wants to merge 1 commit into from

2 participants

@seamusabshere

hi,

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

Best,
Seamus

@seamusabshere

hi, no interest here?

@seamusabshere

hey @banker hope you'll look at this

@banker

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

@banker banker closed this
@seamusabshere

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.
View
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
View
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
opts.merge!(default_grid_io_opts(filename))
del = opts.delete(:delete_old) && mode == 'w'
file = GridIO.new(@files, @chunks, filename, mode, opts)
View
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.