Upgraded Mongoids generated scope to be compatible with Rails 4.