diff options
author | Kir Shatrov <shatrov@me.com> | 2017-07-01 23:09:13 +0300 |
---|---|---|
committer | Kir Shatrov <shatrov@me.com> | 2017-07-06 21:30:43 +0300 |
commit | b3f3d49fd6b91c6573b3e10e3d00f65306638927 (patch) | |
tree | b831a180c5fe686fc47d80f56e46f2e727fac1b5 /actionpack/lib/action_dispatch/routing | |
parent | 6f2b0eb44ab166f98f3bc4a3aa09d3b899e0fd62 (diff) | |
download | rails-b3f3d49fd6b91c6573b3e10e3d00f65306638927.tar.gz rails-b3f3d49fd6b91c6573b3e10e3d00f65306638927.tar.bz2 rails-b3f3d49fd6b91c6573b3e10e3d00f65306638927.zip |
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 d1c5b5a7ff..e01187707a 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 ebe809f64e..6c342a2a52 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 |