1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

8 commits

Author SHA1 Message Date
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
Piotr Sarnacki
051127d4d3 Rails::Engine.find(path) - method to find engine by path 2010-12-09 01:59:54 +01:00
Piotr Sarnacki
32a5b49911 Move singleton pattern to Railtie and remove Engine::Configurable and Application::Configurable in favor of unified Railtie::Configurable 2010-09-03 22:59:05 +02:00
Piotr Sarnacki
675f3ead41 Gather initializers from railties in engines to get rid of additional looping through initializers 2010-09-03 22:59:03 +02:00
Piotr Sarnacki
c787bfdf93 Engine can now load its own plugins 2010-09-03 22:59:03 +02:00
Piotr Sarnacki
ad6be08762 Made Engine valid rack app with its own middleware stack 2010-09-03 22:59:03 +02:00
José Valim
2fde9d774b Solve some pendencies. 2010-01-24 09:32:54 +01:00
José Valim
13d66cdf25 Extract Railtie load from application. 2010-01-23 16:59:37 +01:00