We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
take
Failing test case (for
it 'does not registers an offense when using `#take` with arguments' do expect_no_offenses(<<~RUBY) User.where(id: x).take(5) RUBY end
In the current implementation you’d get
User.where(id: x).take(5) ^^^^^^^^^^^^^^^^^ Use `find_by` instead of `where.take`.
and the line would be autocorrected to
User.where(id: x)(5)
❯ bundle exec rubocop -V 1.18.1 (using Parser 3.0.1.1, rubocop-ast 1.7.0, running on ruby 2.6.6 x86_64-darwin19) - rubocop-performance 1.11.3 - rubocop-rails 2.11.1 - rubocop-rspec 1.29.1
The text was updated successfully, but these errors were encountered:
[Fix rubocop#512] Fix a false positive for Rails/FindBy
Rails/FindBy
4089727
Fix rubocop#512 This PR fixes a false positive for `Rails/FindBy` when using `take` with arguments.
c3f28fc
6a5406a
Merge pull request #513 from koic/fix_false_positive_for_rails_find_by
f8ce31d
[Fix #512] Fix a false positive for `Rails/FindBy`
Successfully merging a pull request may close this issue.
Failing test case (for
In the current implementation you’d get
and the line would be autocorrected to
RuboCop version
The text was updated successfully, but these errors were encountered: