-
-
Notifications
You must be signed in to change notification settings - Fork 253
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
find_by_token_for and Rails/DynamicFindBy #781
Comments
koic
added a commit
to koic/rubocop-rails
that referenced
this issue
Sep 20, 2022
Fixes rubocop#781. This PR fixes a false positive for `Rails/DynamicFindBy` when using `find_by_token_for`. This default setting emphasizes suppressing false positive over false negative. `find_by_token_for` is probably rarely named, but it will always exist in Rails in the future.
9 tasks
koic
added a commit
to koic/rubocop-rails
that referenced
this issue
Sep 20, 2022
Fixes rubocop#781. This PR makes `Rails/DynamicFindBy` aware of `find_by_token_for`. This default setting emphasizes suppressing false positive over false negative. `find_by_token_for` is probably rarely named, but it will always exist in Rails in the future.
koic
added a commit
to koic/rubocop-rails
that referenced
this issue
Sep 26, 2022
Fixes rubocop#781. This PR makes `Rails/DynamicFindBy` aware of `find_by_token_for`. This default setting emphasizes suppressing false positive over false negative. `find_by_token_for` is probably rarely named, but it will always exist in Rails in the future.
koic
added a commit
that referenced
this issue
Sep 28, 2022
…mic_find_by [Fix #781] Fix a false positive for `Rails/DynamicFindBy`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Context
rails/rails#44189 introduced a token generator and a lookup function called find_by_token_for
rubocop-rails confuses it for a model lookup and is not pleased.
I originally posted about this in rails/rails#46065 and was told this is a rubocop-rails issue, so here we are.
Expected behavior
No violations detected.
Actual behavior
Steps to reproduce the problem
ActiveRecord::Base::generates_token_for
rails/rails#44189 (comment)RuboCop version
Thanks :)
The text was updated successfully, but these errors were encountered: