Module: Authenticate::User::ClassMethods

Defined in:
lib/authenticate/user.rb

Overview

Class methods added to users.

Instance Method Summary collapse

Instance Method Details

#find_by_normalized_email(email) ⇒ Object

We need to find users by email even if they don't use email to log in


61
62
63
# File 'lib/authenticate/user.rb', line 61

def find_by_normalized_email(email)
  find_by_email normalize_email(email)
end

#normalize_email(email) ⇒ Object


56
57
58
# File 'lib/authenticate/user.rb', line 56

def normalize_email(email)
  email.to_s.downcase.gsub(/\s+/, '')
end