Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use merge! in some places to avoid creating extra hashes

  • Loading branch information...
commit d98014cbcb0bf38f4ecd433d945047fc67fccc36 1 parent 2b64e9b
@carlosantoniodasilva carlosantoniodasilva authored
View
6 actionpack/lib/action_dispatch/routing/mapper.rb
@@ -152,7 +152,7 @@ def app
end
def conditions
- { :path_info => @path }.merge(constraints).merge(request_method_condition)
+ { :path_info => @path }.merge!(constraints).merge!(request_method_condition)
end
def requirements
@@ -285,7 +285,7 @@ module Base
# of most Rails applications, this is beneficial.
def root(options = {})
options = { :to => options } if options.is_a?(String)
- match '/', { :as => :root, :via => :get }.merge(options)
+ match '/', { :as => :root, :via => :get }.merge!(options)
end
# Matches a url pattern to one or more routes. Any symbols in a pattern
@@ -845,7 +845,7 @@ def merge_blocks_scope(parent, child) #:nodoc:
end
def merge_options_scope(parent, child) #:nodoc:
- (parent || {}).except(*override_keys(child)).merge(child)
+ (parent || {}).except(*override_keys(child)).merge!(child)
end
def merge_shallow_scope(parent, child) #:nodoc:
View
2  actionpack/lib/action_dispatch/routing/redirection.rb
@@ -75,7 +75,7 @@ def path(params, request)
:port => request.optional_port,
:path => request.path,
:params => request.query_parameters
- }.merge options
+ }.merge! options
if !params.empty? && url_options[:path].match(/%\{\w*\}/)
url_options[:path] = (url_options[:path] % escape_path(params))
Please sign in to comment.
Something went wrong with that request. Please try again.