aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--actionpack/CHANGELOG.md4
-rw-r--r--actionpack/lib/action_dispatch/routing/route_set.rb18
-rw-r--r--actionpack/test/dispatch/routing/route_set_test.rb20
3 files changed, 5 insertions, 37 deletions
diff --git a/actionpack/CHANGELOG.md b/actionpack/CHANGELOG.md
index 4201024f1f..7402329b34 100644
--- a/actionpack/CHANGELOG.md
+++ b/actionpack/CHANGELOG.md
@@ -1,3 +1,7 @@
+* Remove deprecated usage of string keys in URL helpers.
+
+ *Rafael Mendonça França*
+
* Remove deprecated `only_path` option on `*_path` helpers.
*Rafael Mendonça França*
diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb
index f23aec0691..b046f5acac 100644
--- a/actionpack/lib/action_dispatch/routing/route_set.rb
+++ b/actionpack/lib/action_dispatch/routing/route_set.rb
@@ -244,7 +244,7 @@ module ActionDispatch
controller_options = t.url_options
options = controller_options.merge @options
hash = handle_positional_args(controller_options,
- deprecate_string_options(inner_options) || {},
+ inner_options || {},
args,
options,
@segment_keys)
@@ -272,22 +272,6 @@ module ActionDispatch
result.merge!(inner_options)
end
-
- DEPRECATED_STRING_OPTIONS = %w[controller action]
-
- def deprecate_string_options(options)
- options ||= {}
- deprecated_string_options = options.keys & DEPRECATED_STRING_OPTIONS
- if deprecated_string_options.any?
- msg = "Calling URL helpers with string keys #{deprecated_string_options.join(", ")} is deprecated. Use symbols instead."
- ActiveSupport::Deprecation.warn(msg)
- deprecated_string_options.each do |option|
- value = options.delete(option)
- options[option.to_sym] = value
- end
- end
- options
- end
end
private
diff --git a/actionpack/test/dispatch/routing/route_set_test.rb b/actionpack/test/dispatch/routing/route_set_test.rb
index 49d53cf270..fe52c50336 100644
--- a/actionpack/test/dispatch/routing/route_set_test.rb
+++ b/actionpack/test/dispatch/routing/route_set_test.rb
@@ -128,26 +128,6 @@ module ActionDispatch
assert_equal '/a/users/1', url_helpers.user_path(1, foo: 'a')
end
- test "stringified controller and action keys are properly symbolized" do
- draw do
- root 'foo#bar'
- end
-
- assert_deprecated do
- assert_equal '/', url_helpers.root_path('controller' => 'foo', 'action' => 'bar')
- end
- end
-
- test "mix of string and symbol keys are properly symbolized" do
- draw do
- root 'foo#bar'
- end
-
- assert_deprecated do
- assert_equal '/', url_helpers.root_path('controller' => 'foo', :action => 'bar')
- end
- end
-
private
def draw(&block)
@set.draw(&block)