This project is archived and is in readonly mode.

#6754 new
bterkuile

mattr_accessor :config for module raises error (actionpack) after server restart

Reported by bterkuile | April 28th, 2011 @ 10:33 AM

mattr_accessor :config for module raises error (actionpack) after server restart.
Putting for example the following in config/initializers/break_it.rb

module BreakIt
  mattr_accessor :config
end
ApplicationController.send(:include, BreakIt)

raises an error the first time a pare is requested after the servers starts (confirmed for webrick and thin):
.... undefined method allow_forgery_protection' for nil:NilClass .... actionpack (3.0.7) lib/action_controller/metal/request_forgery_protection.rb:123:inprotect_against_forgery?'

A similar error, not reproduced here was because:
actionpack (3.0.7) lib/abstract_controller/rendering.rb:131 => protected_instance_variables was nil instead of an array.

I renamed :config to something else to fix it. So low priority, but good to mention I think.

No comments found

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Pages