Open exterm opened 10 months ago
Method calls are unsafe too, since they could reference an unloaded constant:
def account_class
Account
end
has_many :accounts, class_name: account_class
Yeah, this cop will never be able to catch all cases. That's OK. I'm just looking to reduce the number of false positives.
Expected behavior
These are the examples from the docs:
I would also expect
Because the purpose of the cop, if I understand correctly, is to prevent constant references and the autoload they cause, so the cop should only reject constant references.
Actual behavior
The cop rejects everything that is not a string literal.
Steps to reproduce the problem
See above.
RuboCop version
I checked changelog and code and this doesn't seem to be fixed in
2.22.1
, which is the most current version as I'm writing this.