mongoid/mongoid — Issue #1777: Failed validations don't report as failed save
Author: Talby
Created: 2012-03-01 06:17:06+00:00
State: open

calling #save or #create will return an object/true. And #save! and #create! return obj/true and don't raise an error.

>> User.all.destroy
=> 4
>> id = BSON::ObjectId.new
=> BSON::ObjectId('4f4f131a2f28e67dc100000a')
>> u = User.new; u.id = id; u.save!
=> true
>> u = User.new; u.id = id; u.save!
=> true
>> User.count
=> 1

This is using mongoid 3.0.0 (23d9bca52731)