diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-05-29 16:08:56 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-05-29 16:08:56 -0700 |
commit | be137b0ac389c5bed93df4b5a76e19549b8e1cfa (patch) | |
tree | 59b21702790d4712b41838fa361bc542921c7f19 | |
parent | c767fbfc25561b1ba6a9c4ae040169826e5235b8 (diff) | |
download | rails-be137b0ac389c5bed93df4b5a76e19549b8e1cfa.tar.gz rails-be137b0ac389c5bed93df4b5a76e19549b8e1cfa.tar.bz2 rails-be137b0ac389c5bed93df4b5a76e19549b8e1cfa.zip |
no reason to make a Mapper object if the path is blank
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 879e8daa33..e4fd63cf0e 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -91,7 +91,6 @@ module ActionDispatch 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 @@ module ActionDispatch 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\-\/]+$/ |