Skip to content
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

False positives on Rails/DynamicFindBy #3758

Closed
jcoyne opened this issue Dec 1, 2016 · 2 comments
Closed

False positives on Rails/DynamicFindBy #3758

jcoyne opened this issue Dec 1, 2016 · 2 comments

Comments

@jcoyne
Copy link

jcoyne commented Dec 1, 2016

Any method named find_by_* is triggering Rails/DynamicFindBy errors. This is occurring even if the methods are statically defined.

For example any call to this method triggers it:
https://github.com/projecthydra/hydra-head/blob/f63dcc2592fbef6a648ae21e85433db7c2a7749f/hydra-access-controls/lib/hydra/user.rb#L20

@pocke
Copy link
Collaborator

pocke commented Dec 3, 2016

Hi, thanks for your feedback!
I also recognize the problem.
We can use whitelist for the problem.

e.g.

# In .rubocop.yml
Rails/DynamicFindBy:
  Whitelist:
    - find_by_user_key

#3455 (comment)

@bbatsov
Copy link
Collaborator

bbatsov commented Dec 20, 2016

That's the reason the whitelist exists. There's nothing else we can do (apart from disabling the cop).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants