Class: Auth::Behavior::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/auth/behavior/base.rb

Direct Known Subclasses

Core, RememberMe

Defined Under Namespace

Classes: Configuration

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#optionsObject (readonly)

unloadable



4
5
6
# File 'lib/auth/behavior/base.rb', line 4

def options
  @options
end

Class Method Details

.migration(filename) ⇒ Object

Declares a migration template for a behavior. If sourcedir is given, it will be used as the location in which to find the template.



63
64
65
# File 'lib/auth/behavior/base.rb', line 63

def migration(filename)
  migrations << filename unless migrations.include?(filename)
end

Instance Method Details

#apply(model_config) ⇒ Object Also known as: apply_to



8
9
10
11
12
13
14
# File 'lib/auth/behavior/base.rb', line 8

def apply(model_config)
  track_behavior(model = model_config.target) do
    apply_to_user(model)
    apply_to_password(Password, model)
    apply_to_controller(Auth.base_controller, model)
  end
end

#apply_to_controller(base_controller, user_model) ⇒ Object



18
19
20
# File 'lib/auth/behavior/base.rb', line 18

def apply_to_controller(base_controller, user_model)
  be_sure_to_override("apply_to_controller(base_controller, user_model)")
end

#apply_to_password(password_model, user_model) ⇒ Object



22
23
24
# File 'lib/auth/behavior/base.rb', line 22

def apply_to_password(password_model, user_model)
  be_sure_to_override("apply_to_password(password_model, user_model)")
end

#apply_to_user(user_model) ⇒ Object



26
27
28
# File 'lib/auth/behavior/base.rb', line 26

def apply_to_user(user_model)
  be_sure_to_override("apply_to_user(user_model)")
end