-
Notifications
You must be signed in to change notification settings - Fork 87
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
NameError (uninitialized constant Mobility::ActiveRecord::VERSION) #258
Comments
I suppose the solution would be for all class names which potentially conflict with base classes (
I've avoided doing this because it feels like it shouldn't be necessary, and I do think that it's the gem owner's responsibility to always call the base class explicitly (Mobility does this everywhere). But OTOH this could cause very strange bugs which might be harder to track down than the one in this issue. If anyone has any thoughts or ideas, I'd be eager to hear before making this change. cc @pwim |
From the perspective of a user of the library, whether it is named From the perspective of a developer of the library, I understand the aesthetic appeal of You're right that other gems should use If we wanted to avoid this issue by renaming things, I suppose not everything would need to get renamed. I think this is only an issue for modules we add to objects created in the user application. I haven't looked into it in detail, but it might be possible to rename |
I like the |
@shioyama I'm having this problem as well. is there a recommended temporary fix I could do on my end? |
@maebeale Sorry I haven't looked into this for a while, but one thing is that |
This was fixed by #464. Everything is now namespaced under This applies to |
I did a plain install into my existing rails 5.2 (activerecord) project
and added Mobility to my
Event
class.Expected Behavior
My app still works.
Actual Behavior
Event.new
does not work anymore.This happens I think because
extend Mobility
doesinclude Mobility::ActiveRecord
.When the call to
multi_tenant
from theactiverecord-multi-tenant
gem is called, it wants to look upActiveRecord
but it will findMobility::ActiveRecord
now.So by including
mobility
into my project, the project broke.Possible Fix
The same issue was discussed in #69 . But as far a I can see the issue was closed prematurely because the cause is not
extend Mobility
, it is theinclude Mobility::ActiveRecord
.Also see citusdata/activerecord-multi-tenant#42 for a work around .
The text was updated successfully, but these errors were encountered: