Module: Authlogic::Session::Activation::ClassMethods
- Defined in:
- lib/authlogic/session/activation.rb
Instance Method Summary collapse
-
#activated? ⇒ Boolean
Returns true if a controller has been set and can be used properly.
-
#controller ⇒ Object
The current controller object.
-
#controller=(value) ⇒ Object
This accepts a controller object wrapped with the Authlogic controller adapter.
Instance Method Details
#activated? ⇒ Boolean
Returns true if a controller has been set and can be used properly. This MUST be set before anything can be done. Similar to how ActiveRecord won’t allow you to do anything without establishing a DB connection. In your framework environment this is done for you, but if you are using Authlogic outside of your framework, you need to assign a controller object to Authlogic via Authlogic::Session::Base.controller = obj. See the controller= method for more information.
36 37 38 |
# File 'lib/authlogic/session/activation.rb', line 36 def activated? !controller.nil? end |
#controller ⇒ Object
The current controller object
53 54 55 |
# File 'lib/authlogic/session/activation.rb', line 53 def controller RequestStore.store[:authlogic_controller] end |
#controller=(value) ⇒ Object
This accepts a controller object wrapped with the Authlogic controller adapter. The controller adapters close the gap between the different controllers in each framework. That being said, Authlogic is expecting your object’s class to extend Authlogic::ControllerAdapters::AbstractAdapter. See Authlogic::ControllerAdapters for more info.
Lastly, this is thread safe.
48 49 50 |
# File 'lib/authlogic/session/activation.rb', line 48 def controller=(value) RequestStore.store[:authlogic_controller] = value end |