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:



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

def self.included(klass) # :nodoc:
  if defined?(::ApplicationController)
    raise AuthlogicLoadedTooLateError.new(
      "        Authlogic is trying to add a callback to ActionController::Base but\n        ApplicationController has already been loaded, so the callback won't\n        be copied into your application. Generally this is due to another gem or\n        plugin requiring your ApplicationController prematurely, such as the\n        resource_controller plugin. Please require Authlogic first, before these\n        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