mirror of https://github.com/rails/rails
Plugins need to load before app initializers
This commit is contained in:
parent
3b6f659fb6
commit
2d1f9fb98f
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue