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

Does Not Work with Mongoid 5 #277

Closed
rdetert opened this issue Oct 24, 2015 · 2 comments
Closed

Does Not Work with Mongoid 5 #277

rdetert opened this issue Oct 24, 2015 · 2 comments
Assignees
Labels

Comments

@rdetert
Copy link

rdetert commented Oct 24, 2015

Mongoid 5 is required for MongoDB 3 (the latest version). AASM doesn't seem to work with Mongoid 5.

Here is a test project: https://github.com/rdetert/aasmtest
Use the model tester.rb.

To see the error type:
$ rails c
2.1.5 :001 > Tester.drafting

If you revert the Gemfile back to Mongoid 4, the error goes away.

Here is the error:

NoMethodError: undefined method `aasm' for nil:NilClass
    from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/aasm-4.3.0/lib/aasm/persistence/base.rb:72:in `block in state_with_scope'
    from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/mongoid-5.0.0/lib/mongoid/scopable.rb:316:in `instance_exec'
    from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/mongoid-5.0.0/lib/mongoid/scopable.rb:316:in `block (2 levels) in define_scope_method'
    from (irb):1
    from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/railties-4.1.13/lib/rails/commands/console.rb:90:in `start'
    from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/railties-4.1.13/lib/rails/commands/console.rb:9:in `start'
    from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/railties-4.1.13/lib/rails/commands/commands_tasks.rb:69:in `console'
    from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/railties-4.1.13/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
    from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/railties-4.1.13/lib/rails/commands.rb:17:in `<top (required)>'
    from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.13/lib/active_support/dependencies.rb:247:in `require'
    from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.13/lib/active_support/dependencies.rb:247:in `block in require'
    from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.13/lib/active_support/dependencies.rb:232:in `load_dependency'
    from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.13/lib/active_support/dependencies.rb:247:in `require'
    from /Users/ryan/src/aasmtest/bin/rails:8:in `<top (required)>'
    from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.13/lib/active_support/dependencies.rb:241:in `load'
    from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.13/lib/active_support/dependencies.rb:241:in `block in load'
    from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.13/lib/active_support/dependencies.rb:232:in `load_dependency'
    from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.13/lib/active_support/dependencies.rb:241:in `load'
    from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/spring-1.4.0/lib/spring/commands/rails.rb:6:in `call'
    from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/spring-1.4.0/lib/spring/command_wrapper.rb:38:in `call'
    from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/spring-1.4.0/lib/spring/application.rb:183:in `block in serve'
    from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/spring-1.4.0/lib/spring/application.rb:156:in `fork'
    from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/spring-1.4.0/lib/spring/application.rb:156:in `serve'
    from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/spring-1.4.0/lib/spring/application.rb:131:in `block in run'
    from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/spring-1.4.0/lib/spring/application.rb:125:in `loop'
    from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/spring-1.4.0/lib/spring/application.rb:125:in `run'
    from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/spring-1.4.0/lib/spring/application/boot.rb:18:in `<top (required)>'
    from /Users/ryan/.rvm/rubies/ruby-2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /Users/ryan/.rvm/rubies/ruby-2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'

@alto alto self-assigned this Oct 27, 2015
@alto alto added the bug label Oct 27, 2015
@alto
Copy link
Member

alto commented Oct 27, 2015

@rdetert You are right. AASM's tests have errors as well with version 5. Thanks for pointing that out!

@alto
Copy link
Member

alto commented Oct 27, 2015

I just released version 4.4.0 including a patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants