Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Refactor RoutesReloader a bit to avoid creating extra hash objects

  • Loading branch information...
commit 72a2edd8c308cf63237b9e010f6595fd3ad08463 1 parent af024f4
Carlos Antonio da Silva carlosantoniodasilva authored
Showing with 2 additions and 3 deletions.
  1. +2 −3 railties/lib/rails/application/routes_reloader.rb
5 railties/lib/rails/application/routes_reloader.rb
View
@@ -24,12 +24,11 @@ def reload!
def updater
@updater ||= begin
- dirs = @external_routes.inject({}) do |hash, dir|
- hash.merge(dir.to_s => ["rb"])
+ dirs = @external_routes.each_with_object({}) do |dir, hash|
+ hash[dir.to_s] = %w(rb)
end
updater = ActiveSupport::FileUpdateChecker.new(paths, dirs) { reload! }
-
updater.execute
updater
end
Please sign in to comment.
Something went wrong with that request. Please try again.