1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Plugins need to load before app initializers

This commit is contained in:
Joshua Peek 2010-01-25 11:06:39 -06:00
parent 3b6f659fb6
commit 2d1f9fb98f
2 changed files with 14 additions and 1 deletions

View file

@ -91,8 +91,8 @@ module Rails
def initializers def initializers
initializers = Bootstrap.initializers initializers = Bootstrap.initializers
initializers += super
railties.all { |r| initializers += r.initializers } railties.all { |r| initializers += r.initializers }
initializers += super
initializers += Finisher.initializers initializers += Finisher.initializers
initializers initializers
end end

View file

@ -37,6 +37,19 @@ module PluginsTest
assert_equal "Bukkits", Bukkits.name assert_equal "Bukkits", Bukkits.name
end 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 test "plugin paths get added to the AS::Dependency list" do
boot_rails boot_rails
assert_equal "Bukkits", Bukkits.name assert_equal "Bukkits", Bukkits.name