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:
parent
3b6f659fb6
commit
2d1f9fb98f
2 changed files with 14 additions and 1 deletions
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue