diff options
Diffstat (limited to 'actionpack/lib/action_dispatch/routing/mapper.rb')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 67b9463a6a..c481c190bf 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -1558,11 +1558,7 @@ module ActionDispatch options = path path, to = options.find { |name, _value| name.is_a?(String) } - if path.nil? - ActiveSupport::Deprecation.warn "Omitting the route path is deprecated. "\ - "Specify the path with a String or a Symbol instead." - path = "" - end + raise ArgumentError, "Route path not specified" if path.nil? case to when Symbol @@ -1607,7 +1603,7 @@ module ActionDispatch def root(path, options = {}) if path.is_a?(String) options[:to] = path - elsif path.is_a?(Hash) and options.empty? + elsif path.is_a?(Hash) && options.empty? options = path else raise ArgumentError, "must be called with a path and/or options" @@ -1844,18 +1840,7 @@ module ActionDispatch path_types.fetch(String, []).each do |_path| route_options = options.dup if _path && option_path - ActiveSupport::Deprecation.warn <<-eowarn -Specifying strings for both :path and the route path is deprecated. Change things like this: - - match #{_path.inspect}, :path => #{option_path.inspect} - -to this: - - match #{option_path.inspect}, :as => #{_path.inspect}, :action => #{_path.inspect} - eowarn - route_options[:action] = _path - route_options[:as] = _path - _path = option_path + raise ArgumentError, "Ambigous route definition. Both :path and the route path where specified as strings." end to = get_to_from_path(_path, to, route_options[:action]) decomposed_match(_path, controller, route_options, _path, to, via, formatted, anchor, options_constraints) |