mongoid/mongoid — pull request #1772 by byroot (2012-02-28 16:19:16+00:00)
Title: Cast #limit() and #skip() arguments as Integer

To avoid raising ArgumentError deep inside Mongo's driver:
`MyModel.limit("2").to_a`

Before this patch:

```
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'
```

With this patch: Work just like `MyModel.limit(2).to_a`