Skip to content

Commit cc2e097

Browse files
committed
Use if/else instead of case without argument
1 parent 8695b02 commit cc2e097

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

activerecord/lib/active_record/relation/finder_methods.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,9 @@ def take!
112112
def sole
113113
found, undesired = first(2)
114114

115-
case
116-
when found.nil?
115+
if found.nil?
117116
raise_record_not_found_exception!
118-
when undesired.present?
117+
elsif undesired.present?
119118
raise ActiveRecord::SoleRecordExceeded.new(self)
120119
else
121120
found

0 commit comments

Comments
 (0)