2017-12-21 17:36:29 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2010-01-24 00:26:06 +00:00
|
|
|
module Devise
|
|
|
|
module Models
|
|
|
|
# Registerable is responsible for everything related to registering a new
|
2010-01-24 23:22:45 +00:00
|
|
|
# resource (ie user sign up).
|
2010-01-24 00:26:06 +00:00
|
|
|
module Registerable
|
2010-07-15 16:13:55 +00:00
|
|
|
extend ActiveSupport::Concern
|
|
|
|
|
2012-02-24 22:56:04 +00:00
|
|
|
def self.required_fields(klass)
|
|
|
|
[]
|
|
|
|
end
|
|
|
|
|
2010-07-15 16:13:55 +00:00
|
|
|
module ClassMethods
|
|
|
|
# A convenience method that receives both parameters and session to
|
2011-02-06 15:34:31 +00:00
|
|
|
# initialize a user. This can be used by OAuth, for example, to send
|
2010-07-15 16:13:55 +00:00
|
|
|
# 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)
|
|
|
|
new(params)
|
|
|
|
end
|
|
|
|
end
|
2010-01-24 00:26:06 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|