REFACTOR: Always validate email by default.

This commit is contained in:
Guo Xiang Tan
2017-10-25 13:02:18 +08:00
parent d9a9ad3edb
commit defea6245c
4 changed files with 7 additions and 7 deletions

View File

@@ -3,7 +3,7 @@ require_dependency 'email_validator'
class UserEmail < ActiveRecord::Base
belongs_to :user
attr_accessor :should_validate_email
attr_accessor :skip_validate_email
before_validation :strip_downcase_email
@@ -24,7 +24,7 @@ class UserEmail < ActiveRecord::Base
end
def validate_email?
return false unless self.should_validate_email
return false if self.skip_validate_email
email_changed?
end
end