diff options
author | Matthew Draper <matthew@trebex.net> | 2017-07-10 00:07:03 +0930 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-10 00:07:03 +0930 |
commit | 551f88366dcbaed3b0abc89bddd63975c4c9a5ca (patch) | |
tree | ab9306fac3d48ff7dc8556076c8d07b38bcfc381 /actionpack/lib/action_dispatch/routing | |
parent | 8d98bb0cc6e2baf1694971ae2bdf19e8b8bcdce5 (diff) | |
parent | b3f3d49fd6b91c6573b3e10e3d00f65306638927 (diff) | |
download | rails-551f88366dcbaed3b0abc89bddd63975c4c9a5ca.tar.gz rails-551f88366dcbaed3b0abc89bddd63975c4c9a5ca.tar.bz2 rails-551f88366dcbaed3b0abc89bddd63975c4c9a5ca.zip |
Merge pull request #29655 from kirs/frozen-friendly-ap-ar
Prepare AP and AR to be frozen string friendly
Diffstat (limited to 'actionpack/lib/action_dispatch/routing')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 3 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/routing/route_set.rb | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index a2ba4e26ea..057ff07fcf 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "active_support/core_ext/hash/slice" require "active_support/core_ext/enumerable" require "active_support/core_ext/array/extract_options" @@ -306,7 +307,7 @@ module ActionDispatch def check_controller_and_action(path_params, controller, action) hash = check_part(:controller, controller, path_params, {}) do |part| translate_controller(part) { - message = "'#{part}' is not a supported controller name. This can lead to potential routing problems." + message = "'#{part}' is not a supported controller name. This can lead to potential routing problems.".dup message << " See http://guides.rubyonrails.org/routing.html#specifying-a-controller-to-use" raise ArgumentError, message diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb index a146d1fb1a..3f15257ed6 100644 --- a/actionpack/lib/action_dispatch/routing/route_set.rb +++ b/actionpack/lib/action_dispatch/routing/route_set.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require_relative "../journey" require "active_support/core_ext/object/to_query" require "active_support/core_ext/hash/slice" @@ -233,7 +234,7 @@ module ActionDispatch missing_keys << missing_key } constraints = Hash[@route.requirements.merge(params).sort_by { |k, v| k.to_s }] - message = "No route matches #{constraints.inspect}" + message = "No route matches #{constraints.inspect}".dup message << ", missing required keys: #{missing_keys.sort.inspect}" raise ActionController::UrlGenerationError, message |