diff options
-rw-r--r-- | railties/lib/rails/application.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/initializable.rb | 9 | ||||
-rw-r--r-- | railties/test/railties/engine_test.rb | 2 |
3 files changed, 4 insertions, 9 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb index aabe86715c..5813c5757d 100644 --- a/railties/lib/rails/application.rb +++ b/railties/lib/rails/application.rb @@ -178,7 +178,7 @@ module Rails railties.all { |r| initializers += r.initializers } initializers += super initializers += Finisher.initializers_for(self) - initializers + Collection.new(initializers) end protected diff --git a/railties/lib/rails/initializable.rb b/railties/lib/rails/initializable.rb index 9a82e051e7..78f9eaf393 100644 --- a/railties/lib/rails/initializable.rb +++ b/railties/lib/rails/initializable.rb @@ -39,11 +39,6 @@ module Rails select { |i| i.before == initializer.name || i.name == initializer.after }.each(&block) end - def initialize(initializers = []) - super(initializers) - replace(tsort) - end - def +(other) Collection.new(to_a + other.to_a) end @@ -51,7 +46,7 @@ module Rails def run_initializers(*args) return if instance_variable_defined?(:@ran) - initializers.each do |initializer| + initializers.tsort.each do |initializer| initializer.run(*args) end @ran = true @@ -94,4 +89,4 @@ module Rails end end end -end
\ No newline at end of file +end diff --git a/railties/test/railties/engine_test.rb b/railties/test/railties/engine_test.rb index b3f65fd00d..3fe01e543c 100644 --- a/railties/test/railties/engine_test.rb +++ b/railties/test/railties/engine_test.rb @@ -41,7 +41,7 @@ module RailtiesTest boot_rails - initializers = Rails.application.initializers + initializers = Rails.application.initializers.tsort index = initializers.index { |i| i.name == "dummy_initializer" } selection = initializers[(index-3)..(index)].map(&:name).map(&:to_s) |