diff options
author | José Valim <jose.valim@gmail.com> | 2009-12-27 13:31:36 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2009-12-27 13:31:36 +0100 |
commit | 7e8b7f46bfc086a36db996420fbee93348c5268e (patch) | |
tree | 7c4e309b378ce6a3d39c60785efc603619e25ac8 /railties/lib/rails/configuration.rb | |
parent | 75ba102a80965b2612df0253d1278581a88b8d66 (diff) | |
download | rails-7e8b7f46bfc086a36db996420fbee93348c5268e.tar.gz rails-7e8b7f46bfc086a36db996420fbee93348c5268e.tar.bz2 rails-7e8b7f46bfc086a36db996420fbee93348c5268e.zip |
Add config.action_controller.include behavior to plugins.
Diffstat (limited to 'railties/lib/rails/configuration.rb')
-rw-r--r-- | railties/lib/rails/configuration.rb | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/railties/lib/rails/configuration.rb b/railties/lib/rails/configuration.rb index 086f67a419..cb321536d2 100644 --- a/railties/lib/rails/configuration.rb +++ b/railties/lib/rails/configuration.rb @@ -1,6 +1,24 @@ require 'active_support/ordered_options' module Rails + # Create a Plugin::Options from ActiveSuppot::OrderedOptions, + # which support the following syntax: + # + # controller.action_controller.include FooBar + # + class Plugin::Options < ActiveSupport::OrderedOptions #:nodoc: + attr_reader :includes + + def initialize(*args) + @includes = [] + super + end + + def include(*args) + @includes.concat(args) + end + end + # Temporarily separate the plugin configuration class from the main # configuration class while this bit is being cleaned up. class Plugin::Configuration @@ -16,7 +34,7 @@ module Rails @options = base.options.dup @middleware = base.middleware.dup else - @options = Hash.new { |h,k| h[k] = ActiveSupport::OrderedOptions.new } + @options = Hash.new { |h,k| h[k] = Rails::Plugin::Options.new } @middleware = ActionDispatch::MiddlewareStack.new end end |