Rename variable so that it is clearer which variable is being referred.

This commit is contained in:
Guo Xiang Tan 2018-03-02 16:41:02 +08:00
parent b9ff6d60b9
commit 642c60c310

View File

@ -992,11 +992,11 @@ class User < ActiveRecord::Base
primary_email.email
end
def email=(email)
def email=(new_email)
if primary_email
new_record? ? primary_email.email = email : primary_email.update(email: email)
new_record? ? primary_email.email = new_email : primary_email.update(email: new_email)
else
build_primary_email(email: email)
build_primary_email(email: new_email)
end
end