Permalink
Browse files

Plugins need to load before app initializers

  • Loading branch information...
1 parent 3b6f659 commit 2d1f9fb98f6b4f7afa469eba57eac4041c8ee539 @josh josh committed Jan 25, 2010
Showing with 14 additions and 1 deletion.
  1. +1 −1 railties/lib/rails/application.rb
  2. +13 −0 railties/test/plugins/vendored_test.rb
@@ -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
@@ -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

Contributor

ericallam commented on 2d1f9fb Feb 8, 2011

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.