diff options
author | Joshua Peek <josh@joshpeek.com> | 2010-01-05 23:37:40 -0600 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2010-01-05 23:37:40 -0600 |
commit | bbe80ae6525ec0c3da22b8d3a598af4126db1a57 (patch) | |
tree | d099ce88368a1d1baedb18a27f0a16f7c4fa91c7 /railties | |
parent | 10389a4c29c5b17083a7fa43b97334b4ea811ec8 (diff) | |
download | rails-bbe80ae6525ec0c3da22b8d3a598af4126db1a57.tar.gz rails-bbe80ae6525ec0c3da22b8d3a598af4126db1a57.tar.bz2 rails-bbe80ae6525ec0c3da22b8d3a598af4126db1a57.zip |
config.plugins should still work with an array of strings
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/application.rb | 7 | ||||
-rw-r--r-- | railties/test/plugins/vendored_test.rb | 8 |
2 files changed, 11 insertions, 4 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb index 3fb4b723ab..b3b48194d4 100644 --- a/railties/lib/rails/application.rb +++ b/railties/lib/rails/application.rb @@ -91,9 +91,10 @@ module Rails # TODO: Fix this method def plugins @plugins ||= begin - plugin_names = config.plugins || [:all] - Railtie.plugins.select { |p| plugin_names.include?(:all) || plugin_names.include?(p.plugin_name) }.map { |p| p.new } + - Plugin.all(config.plugins || [:all], config.paths.vendor.plugins) + plugin_names = (config.plugins || [:all]).map { |p| p.to_sym } + Railtie.plugins.select { |p| + plugin_names.include?(:all) || plugin_names.include?(p.plugin_name) + }.map { |p| p.new } + Plugin.all(plugin_names, config.paths.vendor.plugins) end end diff --git a/railties/test/plugins/vendored_test.rb b/railties/test/plugins/vendored_test.rb index 9a2d40cad8..b3b85891b2 100644 --- a/railties/test/plugins/vendored_test.rb +++ b/railties/test/plugins/vendored_test.rb @@ -191,5 +191,11 @@ module PluginsTest boot_rails assert_equal [:a, :c, :b], $arr end + + test "plugin order array is strings" do + add_to_config "config.plugins = %w( c_plugin all )" + boot_rails + assert_equal [:c, :a, :b], $arr + end end -end
\ No newline at end of file +end |