aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2010-01-25 11:06:39 -0600
committerJoshua Peek <josh@joshpeek.com>2010-01-25 11:06:39 -0600
commit2d1f9fb98f6b4f7afa469eba57eac4041c8ee539 (patch)
treebd2dcb1a8d9390842d5fd04383420c1904fedc3c /railties
parent3b6f659fb6b1ffd323c0bbad36630cc97b96bd5f (diff)
downloadrails-2d1f9fb98f6b4f7afa469eba57eac4041c8ee539.tar.gz
rails-2d1f9fb98f6b4f7afa469eba57eac4041c8ee539.tar.bz2
rails-2d1f9fb98f6b4f7afa469eba57eac4041c8ee539.zip
Plugins need to load before app initializers
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/application.rb2
-rw-r--r--railties/test/plugins/vendored_test.rb13
2 files changed, 14 insertions, 1 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb
index ab66d1e90b..6633c36a21 100644
--- a/railties/lib/rails/application.rb
+++ b/railties/lib/rails/application.rb
@@ -91,8 +91,8 @@ module Rails
def initializers
initializers = Bootstrap.initializers
- initializers += super
railties.all { |r| initializers += r.initializers }
+ initializers += super
initializers += Finisher.initializers
initializers
end
diff --git a/railties/test/plugins/vendored_test.rb b/railties/test/plugins/vendored_test.rb
index 05c01846e1..3977099184 100644
--- a/railties/test/plugins/vendored_test.rb
+++ b/railties/test/plugins/vendored_test.rb
@@ -37,6 +37,19 @@ module PluginsTest
assert_equal "Bukkits", Bukkits.name
end
+ test "plugin init is ran before application initializers" do
+ plugin "foo", "$foo = true" do |plugin|
+ plugin.write "lib/foo.rb", "module Foo; end"
+ end
+
+ app_file 'config/initializers/foo.rb', <<-RUBY
+ raise "no $foo" unless $foo
+ raise "no Foo" unless Foo
+ RUBY
+
+ boot_rails
+ end
+
test "plugin paths get added to the AS::Dependency list" do
boot_rails
assert_equal "Bukkits", Bukkits.name