Skip to content

Commit 7271d5e

Browse files
authored
Merge pull request rails#42987 from entretechno/simplify-pluck-value-first-to-pick-value
`ActiveRecord::InternalMetadata.[]`: Simplify `pluck(:value).first` to `pick(:value)`
2 parents 3401139 + b756042 commit 7271d5e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

activerecord/lib/active_record/internal_metadata.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def []=(key, value)
3232
def [](key)
3333
return unless enabled?
3434

35-
where(key: key).pluck(:value).first
35+
where(key: key).pick(:value)
3636
end
3737

3838
# Creates an internal metadata table with columns +key+ and +value+

0 commit comments

Comments
 (0)