james2m/canard — pull request #15 by ninetwentyfour (2014-01-13 19:36:21+00:00)
Title: Add support for mongoid 4

There is a problem with the user scopes in mongoid 4.0.0.alpha2.

When trying to start rails or run tests with an app using 4.0.0.alpha2 and canard the following error is thrown.

Problem:
Defining a scope of value # on User is not allowed.
Summary:
Scopes in Mongoid must be procs that wrap criteria objects.
Resolution:
Change the scope to be a proc wrapped critera.

Example:
class Band
include Mongoid::Document
scope :inactive, ->{ where(active: false) }
end

This should fix the issue. If you want to wait until 4.0 is out of beta to merge this, that's fine.