Permalink
Browse files

config.plugins should still work with an array of strings

  • Loading branch information...
1 parent 10389a4 commit bbe80ae6525ec0c3da22b8d3a598af4126db1a57 @josh josh committed Jan 6, 2010
Showing with 11 additions and 4 deletions.
  1. +4 −3 railties/lib/rails/application.rb
  2. +7 −1 railties/test/plugins/vendored_test.rb
@@ -91,9 +91,10 @@ def initializers
# 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
@@ -191,5 +191,11 @@ def boot_rails
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
+end

0 comments on commit bbe80ae

Please sign in to comment.