Skip to content

Commit 60cccb7

Browse files
authored
Merge pull request rails#53982 from kivikakk/push-znknxlolwmxv
Use `limit` in `#sole`, not `first`.
2 parents d2ffa44 + 1c3b8d9 commit 60cccb7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

activerecord/lib/active_record/relation/finder_methods.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def take!
141141
#
142142
# Product.where(["price = %?", price]).sole
143143
def sole
144-
found, undesired = first(2)
144+
found, undesired = limit(2)
145145

146146
if found.nil?
147147
raise_record_not_found_exception!

0 commit comments

Comments
 (0)