Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Plugins need to load before app initializers

  • Loading branch information...
commit 2d1f9fb98f6b4f7afa469eba57eac4041c8ee539 1 parent 3b6f659
Joshua Peek josh authored
2  railties/lib/rails/application.rb
View
@@ -91,8 +91,8 @@ def call(env)
def initializers
initializers = Bootstrap.initializers
- initializers += super
railties.all { |r| initializers += r.initializers }
+ initializers += super
initializers += Finisher.initializers
initializers
end
13 railties/test/plugins/vendored_test.rb
View
@@ -37,6 +37,19 @@ def app
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

1 comment on commit 2d1f9fb

Eric Allam

This is also going to load engines initializers before the applications, is that desired behavior? Could be related to this ticket:

https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/6388-engines-static-assets-taking-priority-over-applications#ticket-6388-4

Please sign in to comment.
Something went wrong with that request. Please try again.