Use if/else instead of case without argument
This commit is contained in:
parent
8695b02826
commit
cc2e097fed
|
@ -112,10 +112,9 @@ module ActiveRecord
|
||||||
def sole
|
def sole
|
||||||
found, undesired = first(2)
|
found, undesired = first(2)
|
||||||
|
|
||||||
case
|
if found.nil?
|
||||||
when found.nil?
|
|
||||||
raise_record_not_found_exception!
|
raise_record_not_found_exception!
|
||||||
when undesired.present?
|
elsif undesired.present?
|
||||||
raise ActiveRecord::SoleRecordExceeded.new(self)
|
raise ActiveRecord::SoleRecordExceeded.new(self)
|
||||||
else
|
else
|
||||||
found
|
found
|
||||||
|
|
Loading…
Reference in New Issue