Method: Sorcery::Model#authenticates_with_sorcery!

Defined in:
lib/sorcery/model.rb

#authenticates_with_sorcery!Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/sorcery/model.rb', line 10

def authenticates_with_sorcery!
  @sorcery_config = Config.new

  extend ClassMethods # included here, before submodules, so they can be overriden by them.
  include InstanceMethods
  include TemporaryToken

  include_required_submodules!

  # This runs the options block set in the initializer on the model class.
  ::Sorcery::Controller::Config.user_config.tap{|blk| blk.call(@sorcery_config) if blk}

  define_base_fields
  init_orm_hooks!

  @sorcery_config.after_config << :add_config_inheritance if @sorcery_config.subclasses_inherit_config
  @sorcery_config.after_config.each { |c| send(c) }
end