GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
class Tag < ActiveRecord::Base
class TagType < ActiveRecord::Base
Tag.find_by_name('something') # => NoMethodError: undefined method `find_by_name' for ActiveRecord::Model::Tag:Module
I think users should get warning about it. Something like use ::Tag...
I'm not sure that we can give this a good warning.
Maybe we can rename the Tag module inside ActiveRecord::Model since it only to detect if ActiveRecord::Model is present. cc @jonleighton
We should rename it to ActiveRecord::Tag rather than the currenct ActiveRecord::Model::Tag. Then it won't resolve inside the class. Anyone want to make a patch?