Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid scope error in tests (Mongoid 4) #163

Merged
merged 2 commits into from
May 17, 2014

Conversation

johnnyshields
Copy link
Member

Mongoid 4 throws the following errors when running specs. This PR only modifies the specs/non-lib files to fix it. Verified it works on Mongoid 3 as well.

  • Issues with loading Mongoid Paranoia gem (have also changed to using official release version of Mongoid Paranoia)

  • Scopes must be procs on Mongoid 4

    /lib/mongoid/scopable.rb:306:in `check_scope_validity':  (Mongoid::Errors::InvalidScope)
    Problem:
      Defining a scope of value #<Mongoid::Slug::Criteria:0x4195c20> on Page is not allowed.
    Summary:
     Scopes in Mongoid must be procs that wrap criteria objects.
    Resolution:
     Change the scope to be a proc wrapped critera.
    

@digitalplaywright digitalplaywright merged commit f7c63b6 into mongoid:master May 17, 2014
@digitalplaywright
Copy link
Collaborator

Thanks! The tests are now green again. I fixed the remaining issue after this.

@johnnyshields johnnyshields deleted the fix-spec-errors branch May 17, 2014 06:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants