Module: Authlogic::ControllerAdapters::RailsAdapter::RailsImplementation

Defined in:
lib/authlogic/controller_adapters/rails_adapter.rb

Overview

Lets Authlogic know about the controller object via a before filter, AKA “activates” authlogic.

Class Method Summary collapse

Class Method Details

.included(klass) ⇒ Object

:nodoc:



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/authlogic/controller_adapters/rails_adapter.rb', line 32

def self.included(klass) # :nodoc:
  if defined?(::ApplicationController)
    raise AuthlogicLoadedTooLateError.new(
      "        Authlogic is trying to add a callback to ActionController::Base\n        but ApplicationController has already been loaded, so the\n        callback won't be copied into your application. Generally this\n        is due to another gem or plugin requiring your\n        ApplicationController prematurely, such as the\n        resource_controller plugin. Please require Authlogic first,\n        before these other gems / plugins.\n      EOS\n    )\n  end\n\n  # In Rails 4.0.2, the *_filter methods were renamed to *_action.\n  if klass.respond_to? :prepend_before_action\n    klass.prepend_before_action :activate_authlogic\n  else\n    klass.prepend_before_filter :activate_authlogic\n  end\nend\n".strip_heredoc