mongoid-observers icon indicating copy to clipboard operation
mongoid-observers copied to clipboard

Support for Mongoid 7 & Rails 6?

Open kcore opened this issue 5 years ago • 6 comments

Hi seems like this is breaking for mongoid 7 in rails 6. Are we going to support it anytime soon?

kcore avatar May 10 '20 11:05 kcore

Want to PR?

dblock avatar May 10 '20 19:05 dblock

seems like all we need to point it to master branch of rails_observer (as mentioned in the user guid) without which it is failing. My bad in assuming that it would've been fixed in the last year..

kcore avatar May 11 '20 14:05 kcore

Someone should go and help with https://github.com/rails/rails-observers/issues/53.

dblock avatar May 11 '20 14:05 dblock

well, seems like mongoid-observers isn't playing nice with rspec. dev environment is loading just fine and observers are firing as well, but when I try running my specs (via rspec) it just lights up failing at config.mongoid.observers = :******* Error thrown is -

NoMethodError:
  undefined method `mongoid' for #<Rails::Application::Configuration:0x00007ff5b91a4440>
  Did you mean?  mongoize

Any idea how can I fix this? I can raise a PR as well if you direct me

kcore avatar May 13 '20 11:05 kcore

@dblock looks like rails/rails-observers#53 is already closed. I don't know much about the gem, but anything I can do to help?

kcore avatar May 13 '20 11:05 kcore

looks like including require "mongoid/railtie" in the config/application.rb works and spec loads it up correctly. Should this not be happening and am I majorly missing something?

kcore avatar May 13 '20 12:05 kcore