-
-
Notifications
You must be signed in to change notification settings - Fork 263
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
Rails/Inquiry get triggered on variable/method with the name "inquiry" #319
Comments
koic
added a commit
to koic/rubocop-rails
that referenced
this issue
Aug 6, 2020
Fixes rubocop#319. This PR fixes an false positive for `Rails/Inquiry` when `#inquiry`'s receiver is a variable. It should only detect when receiver is an array literal and a string literal.
9 tasks
koic
added a commit
to koic/rubocop-rails
that referenced
this issue
Aug 9, 2020
Fixes rubocop#319. This PR fixes a false positive for `Rails/Inquiry` when `#inquiry`'s receiver is a variable. It should only detect when receiver is an array literal and a string literal.
koic
added a commit
to koic/rubocop-rails
that referenced
this issue
Aug 9, 2020
Fixes rubocop#319. This PR fixes a false positive for `Rails/Inquiry` when `#inquiry`'s receiver is a variable. It should only detect when receiver is an array literal and a string literal.
koic
added a commit
that referenced
this issue
Aug 9, 2020
[Fix #319] Fix a false positive for `Rails/Inquiry`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I have an issue where Rails/Inquiry is triggered on an
inquiry
method of my class. Since I have a model callInquiry
, I also use a method to get an instance, with the same name.It also happens a lot in the specs, since I use
let
to define an instance ofInquiry
.Expected behavior
Rails/Inquiry should not be triggered on variable/method calls, only on Array#inquiry and String#inquiry (which I believe are called with a dot prior to
inquiry
?)Actual behavior
In my application I have a model called
Inquiry
. It makes false positives in two cases:inquiry
that trigger the cop.let (:inquiry) ...
, and then use the variable, it triggers the cop also.Steps to reproduce the problem
I think the easier way is to have a minimal class with a method
inquiry
and calling it.Also have a spec with a
let (:inquiry) ...
used afterward.RuboCop version
The text was updated successfully, but these errors were encountered: