1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/railties/lib/rails
Joseph Wong 29dfe05e07 Patch for #1458 - [3.1.0.rc1] App plugins initialized before engines
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.
2011-06-16 13:24:33 -07:00
..
application Patch for #1458 - [3.1.0.rc1] App plugins initialized before engines 2011-06-16 13:24:33 -07:00
commands replace dev.ror.com plugin url with a dummy one 2011-06-16 21:28:42 +05:30
console Move sandbox to AR and pass the sandbox as a value. This way, other ORMs like Datamapper can also have their own sandboxing in rails console. 2011-05-04 16:47:35 +02:00
engine Use namespace if it's a mountable engine 2011-06-07 11:21:38 +02:00
generators Make the API for compression consistent between JS and CSS. By default, users just need to say whether they want compression or not, and a default will be chosen by a Railtie. In the case of CSS, this default is already chosen by the sass-rails gem. 2011-06-16 12:09:36 -07:00
rack Removed AS core_ext/kernel/requires as it's not used and is bad practice. 2011-05-23 15:31:33 +02:00
railtie adds missing require 2011-06-07 12:06:02 +02:00
tasks sprockets gzips assets now 2011-06-07 21:58:40 +02:00
test_unit
all.rb
application.rb Cherry-picking patch for https://github.com/rails/rails/issues/1460 2011-06-16 10:52:05 -07:00
backtrace_cleaner.rb
cli.rb Exit with non-zero to signal failure. 2011-01-29 16:51:40 +08:00
code_statistics.rb fix indentation 2011-05-25 23:47:31 +05:30
commands.rb Merge pull request #1356 from flippingbits/fix_engine_generator 2011-06-09 00:01:00 -07:00
configuration.rb Update generator config to support hiding namespaces and pass the app into generator blocks 2011-05-24 16:04:28 -07:00
engine.rb Cherry-picking patch for https://github.com/rails/rails/issues/1460 2011-06-16 10:52:05 -07:00
generators.rb Use mattr_accessor :namespace 2011-06-07 11:36:11 +02:00
info.rb
info_controller.rb
initializable.rb
paths.rb fix Rails::Paths::Root document 2011-05-25 16:40:45 +08:00
performance_test_help.rb
plugin.rb
rack.rb Temporarily ship with ContentLength middleware. 2011-05-20 22:20:51 +02:00
railtie.rb load_generators from engine should also handle self automatically. 2011-06-15 15:53:58 -03:00
ruby_version_check.rb
rubyprof_ext.rb
script_rails_loader.rb
source_annotation_extractor.rb removes some remaining .rjs occurrences 2011-04-13 13:24:33 +02:00
tasks.rb Remove the ability for engines to serve assets from the public directory. 2011-04-15 19:57:52 +02:00
test_help.rb Removed AS core_ext/kernel/requires as it's not used and is bad practice. 2011-05-23 15:31:33 +02:00
version.rb Bump versions for rc1 2011-05-21 20:56:52 -05:00