Permalink
Browse files

no reason to make a Mapper object if the path is blank

  • Loading branch information...
1 parent c767fbf commit be137b0ac389c5bed93df4b5a76e19549b8e1cfa @tenderlove tenderlove committed May 29, 2014
Showing with 2 additions and 1 deletion.
  1. +2 −1 actionpack/lib/action_dispatch/routing/mapper.rb
@@ -91,7 +91,6 @@ def to_route
private
def normalize_path!(path, format)
- raise ArgumentError, "path is required" if path.blank?
path = Mapper.normalize_path(path)
if format == true
@@ -1500,6 +1499,8 @@ def decomposed_match(path, options) # :nodoc:
def add_route(action, options) # :nodoc:
path = path_for_action(action, options.delete(:path))
+ raise ArgumentError, "path is required" if path.blank?
+
action = action.to_s.dup
if action =~ /^[\w\-\/]+$/

0 comments on commit be137b0

Please sign in to comment.