Skip to content

A platform for community discussion. Free, open, simple.

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

Guo Xiang Tan642c60c310e8
diff --git a/app/models/user.rb b/app/models/user.rb
index 78a3c9adf47..f25099c27af 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -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