optimize code

This commit is contained in:
Marcia
2016-09-27 13:07:06 +02:00
parent fa833f5a4a
commit 78c6a30424
8 changed files with 49 additions and 105 deletions

View File

@@ -57,6 +57,8 @@
before_validation :clean_document_number
before_create :set_password_changed_at
# Get the existing user by email if the provider gives us a verified email.
def self.first_or_initialize_for_oauth(auth)
oauth_email = auth.info.email
@@ -240,6 +242,10 @@
true
end
def set_password_changed_at
set_password_changed_at = created_at
end
def ability
@ability ||= Ability.new(self)
end