diff options
-rw-r--r-- | railties/lib/rails/application.rb | 2 | ||||
-rw-r--r-- | railties/test/railties/engine_test.rb | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb index 6d3349c61b..d92117f97e 100644 --- a/railties/lib/rails/application.rb +++ b/railties/lib/rails/application.rb @@ -188,7 +188,7 @@ module Rails end all = (railties.all - order) - all.push(self) unless all.include?(self) + all.push(self) unless (all + order).include?(self) order.push(:all) unless order.include?(:all) index = order.index(:all) diff --git a/railties/test/railties/engine_test.rb b/railties/test/railties/engine_test.rb index 400cae98b2..1a92f2f499 100644 --- a/railties/test/railties/engine_test.rb +++ b/railties/test/railties/engine_test.rb @@ -752,6 +752,10 @@ module RailtiesTest get("/assets/bar.js") assert_equal "// App's bar js\n;", last_response.body.strip + + # ensure that railties are not added twice + railties = Rails.application.ordered_railties.map(&:class) + assert_equal railties, railties.uniq end test "railties_order adds :all with lowest priority if not given" do |