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

Conflict with model named Apartment #621

Open
etewiah opened this issue Oct 29, 2019 · 2 comments
Open

Conflict with model named Apartment #621

etewiah opened this issue Oct 29, 2019 · 2 comments

Comments

@etewiah
Copy link

etewiah commented Oct 29, 2019

I have a model in my application named Apartment which is obviously creating a conflict. For example when I have "Apartment.all.count" in my code I get this error:

undefined method 'all' for Apartment:Module

Is there some way to rename the Apartment gem or place it in its own namespace? The app I'm working on is a legacy app and the Apartment model is used in too many places for a renaming of that model to work.

@gliv
Copy link

gliv commented Dec 31, 2019

You should probably rather attempt to namespace your own classes, however this (hack) may work for you @etewiah https://stackoverflow.com/questions/8449134/equivalent-to-pythons-dynamic-import-statement-in-ruby

@etewiah
Copy link
Author

etewiah commented Jan 2, 2020

Thanks for the tip @gliv , I'll look into that. Happy 2020!

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

No branches or pull requests

2 participants