mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
29dfe05e07
and plugins inside engines It seems that plugins inside a Rails 3.1 application proper (i.e. in /vendor/plugins) are initialized before engines and plugins inside engines. After some debugging, I found the culprit in Rails::Application::Railties#all: def all(&block) @all ||= railties + engines + super @all.each(&block) if block @all end The call to super here implicitly passes the &block argument, which has the unfortunate side-effect of adding the plugin initializers first (in front of other railties and engines) in the case of Rails::Engine#initializers: def initializers initializers = [] railties.all { |r| initializers += r.initializers } initializers += super initializers end The solution here is to replace the super call with a call to #plugins. |
||
---|---|---|
.. | ||
application | ||
commands | ||
console | ||
engine | ||
generators | ||
rack | ||
railtie | ||
tasks | ||
test_unit | ||
all.rb | ||
application.rb | ||
backtrace_cleaner.rb | ||
cli.rb | ||
code_statistics.rb | ||
commands.rb | ||
configuration.rb | ||
engine.rb | ||
generators.rb | ||
info.rb | ||
info_controller.rb | ||
initializable.rb | ||
paths.rb | ||
performance_test_help.rb | ||
plugin.rb | ||
rack.rb | ||
railtie.rb | ||
ruby_version_check.rb | ||
rubyprof_ext.rb | ||
script_rails_loader.rb | ||
source_annotation_extractor.rb | ||
tasks.rb | ||
test_help.rb | ||
version.rb |