To avoid raising ArgumentError deep inside Mongo's driver: `MyModel.limit("2").to_a` => mongo-1.5.2/lib/mongo/cursor.rb:272:in `>' mongo-1.5.2/lib/mongo/cursor.rb:272:in `batch_size' mongo-1.5.2/lib/mongo/cursor.rb:80:in `initialize' mongo-1.5.2/lib/mongo/collection.rb:236:in `new' mongo-1.5.2/lib/mongo/collection.rb:236:in `find' mongoid-2.4.4/lib/mongoid/collections/master.rb:25:in `block in find' mongoid-2.4.4/lib/mongoid/collections/retry.rb:29:in `retry_on_connection_failure' mongoid-2.4.4/lib/mongoid/collections/master.rb:24:in `find' mongoid-2.4.4/lib/mongoid/collection.rb:42:in `find' mongoid-2.4.4/lib/mongoid/contexts/mongo.rb:175:in `block in execute' mongoid-2.4.4/lib/mongoid/contexts/mongo.rb:478:in `selecting' mongoid-2.4.4/lib/mongoid/contexts/mongo.rb:169:in `execute' mongoid-2.4.4/lib/mongoid/contexts/mongo.rb:261:in `iterate' mongoid-2.4.4/lib/mongoid/criteria.rb:145:in `block in each' mongoid-2.4.4/lib/mongoid/criteria.rb:145:in `tap' mongoid-2.4.4/lib/mongoid/criteria.rb:145:in `each'
In Rails >3.1.0 updates_attributes accepts an additional options hash so we do, too. Its used for mass assignment security.
Add one missing replacement of localhost vs envvar
add information about which locale is blank in validate_presence_of on localize field
…n localize field
- Add some tests, use duck typing - Prefer array check of exceptions as control flow
When there were pushes (or pulls) as well as elements being reordered, save would only push (or pull) elements. The changed order of the other elements were lost. With this change, checking is done to ensure that we only push when the new elements are at the end, and pull when the remaining element's order has not changed.
- Generate a new document version unless the changed attributes include only updated_at