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

+ (Object) included(klass)

:nodoc:



29
30
31
32
33
34
35
36
37
38
39
# File 'lib/authlogic/controller_adapters/rails_adapter.rb', line 29

def self.included(klass) # :nodoc:
  if defined?(::ApplicationController)
    raise AuthlogicLoadedTooLateError.new("Authlogic is trying to prepend a before_filter in ActionController::Base to active itself" +
      ", the problem is that ApplicationController has already been loaded meaning the before_filter won't get copied into your" +
      " application. Generally this is due to another gem or plugin requiring your ApplicationController prematurely, such as" +
      " the resource_controller plugin. The solution is to require Authlogic before these other gems / plugins. Please require" +
      " authlogic first to get rid of this error.")
  end
  
  klass.prepend_before_filter :activate_authlogic
end