-
-
Save harssh/2015ea47f61b44c2d82c8f672d18e4ba to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Devise | |
module Models | |
# Registerable is responsible for everything related to registering a new | |
# resource (ie user sign up). | |
module Registerable | |
extend ActiveSupport::Concern | |
module ClassMethods | |
# A convenience method that receives both parameters and session to | |
# initialize a user. This can be used by OAuth, for example, to send | |
# in the user token and be stored on initialization. | |
# | |
# By default discards all information sent by the session by calling | |
# new with params. | |
def new_with_session(params, session) | |
user = new(params) | |
if data = session["devise.facebook_data"] | |
user.email = data["user_info"]["email"] | |
end | |
user | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment