We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents b2c2450 + acc1f4f commit 582af1eCopy full SHA for 582af1e
lib/rubocop/cop/rails/pick.rb
@@ -9,6 +9,10 @@ module Rails
9
# `pick` avoids. When called on an Active Record relation, `pick` adds a
10
# limit to the query so that only one value is fetched from the database.
11
#
12
+ # Note that when `pick` is added to a relation with an existing limit, it
13
+ # causes a subquery to be added. In most cases this is undesirable, and
14
+ # care should be taken while resolving this violation.
15
+ #
16
# @safety
17
# This cop is unsafe because `pluck` is defined on both `ActiveRecord::Relation` and `Enumerable`,
18
# whereas `pick` is only defined on `ActiveRecord::Relation` in Rails 6.0. This was addressed
0 commit comments