New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The 'safe' write concern option has been deprecated in favor of 'w' #507
Comments
The deprecation notice is actually coming from the mongo-ruby-driver one level below: In short: # deprecated syntax, triggers warning
collection.save doc, :safe => true
# new syntax for "safe" mode
collection.save doc, :w => 1 You can read more about the deprecation of "safe" here: You can read more about MongoDB's write concerns here: |
@stfairy Here is a quick and dirty monkey patch: # Monkey Patch to solve issue https://github.com/jnunemaker/mongomapper/issues/507
module MongoMapper
module Plugins
module Querying
private
def save_to_collection(options={})
@_new = false
collection.save(to_mongo, :w => options[:safe] ? 1 : 0)
end
end
end
end I wonder, why is this not already fixed? |
+1 |
FYI, the master has this fixed (though not the latest gem). |
This is fixed in master. Closing. |
I'm running the code below and got a warning message:
Google gives something related: http://www.manning-sandbox.com/thread.jspa?messageID=135496&tstart=0
The text was updated successfully, but these errors were encountered: