lib/authenticate/user.rb in authenticate-0.3.1 vs lib/authenticate/user.rb in authenticate-0.3.2
- old
+ new
@@ -1,11 +1,10 @@
require 'authenticate/configuration'
require 'authenticate/token'
require 'authenticate/callbacks/authenticatable'
module Authenticate
-
# Required to be included in your configured user class, which is `User` by
# default, but can be changed with {Configuration#user_model=}.
#
# class User
# include Authenticate::User
@@ -50,21 +49,18 @@
def reset_session_token!
generate_session_token
save validate: false
end
+ # Class methods added to users.
module ClassMethods
-
def normalize_email(email)
email.to_s.downcase.gsub(/\s+/, '')
end
# We need to find users by email even if they don't use email to log in
def find_by_normalized_email(email)
find_by_email normalize_email(email)
end
-
- end
-
+ end
end
end
-