Closed
Description
Is your feature request related to a problem? Please describe.
Some keywords, which is allowed by AR, conflict Rails features.
The most popular example is "type". It conflicts with STI.
And we can find other examples.
class C < ApplicationRecord
enum x: {
:present, # It breaks C#present?
:none,
}
end
Describe the solution you'd like
Detect the dangerous names by RuboCop.
Describe alternatives you've considered
In the enum case, we can use _prefix: true
option instead.
So the cop should be aware of the option.
Additional context
I think we need more examples for the cop. If you have any idea, please comment to this issue!
I was inspired by ruby-jp members. Thanks a lot!