aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/application.rb
diff options
context:
space:
mode:
authorecoologic <erikecoologic@gmail.com>2014-10-07 23:17:56 +1000
committerecoologic <erikecoologic@gmail.com>2014-10-07 23:17:56 +1000
commit117f09c5d1eb600908001bb7b5ee353756e56456 (patch)
tree717d45020cf652840f90c09579692e30bf31237b /railties/lib/rails/application.rb
parent8caf16a281260fedb0677c85047469e99c48da94 (diff)
parent75780373af9a3ddd4cc1bda3d4dbfe6121102b2e (diff)
downloadrails-117f09c5d1eb600908001bb7b5ee353756e56456.tar.gz
rails-117f09c5d1eb600908001bb7b5ee353756e56456.tar.bz2
rails-117f09c5d1eb600908001bb7b5ee353756e56456.zip
Merge remote-tracking branch 'origin/master' into guides-template-inheritance
Diffstat (limited to 'railties/lib/rails/application.rb')
-rw-r--r--railties/lib/rails/application.rb17
1 files changed, 9 insertions, 8 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb
index 6a4660bad0..67d5bac700 100644
--- a/railties/lib/rails/application.rb
+++ b/railties/lib/rails/application.rb
@@ -414,8 +414,14 @@ module Rails
end
end
+ # Return an array of railties respecting the order they're loaded
+ # and the order specified by the +railties_order+ config.
+ #
+ # While when running initializers we need engines in reverse
+ # order here when copying migrations from railties we need then in the same
+ # order as given by +railties_order+
def migration_railties # :nodoc:
- (ordered_railties & railties_without_main_app).reverse
+ ordered_railties.flatten - [self]
end
protected
@@ -448,11 +454,6 @@ module Rails
super
end
- def railties_without_main_app # :nodoc:
- @railties_without_main_app ||= Rails::Railtie.subclasses.map(&:instance) +
- Rails::Engine.subclasses.map(&:instance)
- end
-
# Returns the ordered railties for this application considering railties_order.
def ordered_railties #:nodoc:
@ordered_railties ||= begin
@@ -472,13 +473,13 @@ module Rails
index = order.index(:all)
order[index] = all
- order.reverse.flatten
+ order
end
end
def railties_initializers(current) #:nodoc:
initializers = []
- ordered_railties.each do |r|
+ ordered_railties.reverse.flatten.each do |r|
if r == self
initializers += current
else