Velir/open_id_authentication — Issue #7: Name error in Rails 3 block of open_id_authentication.rb
Author: ndbradley730
Created: 2011-11-17 22:28:55+00:00
State: open

When running Rails 3.0.9, the code block in the OpenIdAuthentication module has a name reference problem:

if Rails.version >= '3'
class Railtie < ::Rails::Railtie
config.app_middleware.use OpenIdAuthentication

config.after_initialize do
OpenID::Util.logger = Rails.logger
end

ActiveSupport.on_load :action_controller do
ActionController::Base.send :include, ControllerMethods # problem here
#ActionController::Base.extend ControllerMethods
end
end
end

This is because the ControllerMethods module appears *below* the code here, so the interpreter hasn't reached it yet. Moving the ControllerMethods module to the top of the OpenIdAuthentication module will fix this.