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
This fixes #121 #123
This fixes #121 #123
Conversation
We have CI running here against all versions of Mongoid, and with version 4 Mongoid::Observer is most definitely deprecated. There're dozens of other gems that do it the same way, including mongoid-slug for example. Are you using another gem that (re)introduces the observer backward compatibility? I think comparing with a string is extremely brittle, I'd be probably OK with something that introduces a proper version parser here from a thirdparty gem. |
These are my mongoid related gems.
I did consider using this gem as version comparing tool but did not pollute gem file. :) |
Well, likely that mongoid-observers is where this comes from :) As mentioned above I would be ok with a reliable version parser to verify which version of mongoid it is. |
Yes, mongoid-observers is the main guilty :) |
@dblock I do not have any idea why this commit crashes on rubinius. I did not find anything on google. Will you merge this one or do you know anything about this crash? Thanks. |
The Rubinius failures look related to infrastructure (bundler not running properly), so probably not introduced by this commit. Travis will probably succeed if we run it again. |
This has been merged via 7ab06f4. |
I had to undo this, opened #126, the rbx failure is in blockenspiel, and will continue breaking the build until that's fixed - dazuma/blockenspiel#13. |
In mongoid4
::Mongoid.const_defined? :Observer
always returns true. So we should check it by mongoid natural version number. BTW this fix works for me.Another workaround is here but I did not test it.