Fix Style/GuardClause in User#wrap_email_confirmation (#35524)
This commit is contained in:
@@ -466,16 +466,17 @@ class User < ApplicationRecord
|
|||||||
|
|
||||||
yield
|
yield
|
||||||
|
|
||||||
if new_user
|
after_confirmation_tasks if new_user
|
||||||
# Avoid extremely unlikely race condition when approving and confirming
|
end
|
||||||
# the user at the same time
|
|
||||||
reload unless approved?
|
|
||||||
|
|
||||||
if approved?
|
def after_confirmation_tasks
|
||||||
prepare_new_user!
|
# Handle condition when approving and confirming a user at the same time
|
||||||
else
|
reload unless approved?
|
||||||
notify_staff_about_pending_account!
|
|
||||||
end
|
if approved?
|
||||||
|
prepare_new_user!
|
||||||
|
else
|
||||||
|
notify_staff_about_pending_account!
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user