aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing/route_set.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2014-08-01 11:45:52 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2014-08-01 11:45:59 -0700
commit8cbcd19d7079db1b5df6ddb3b813fea57cd5cc38 (patch)
tree04003c42b327f96af1dfc028089bab2f86c9c82c /actionpack/lib/action_dispatch/routing/route_set.rb
parentcfbb5a28cc2f7062f2812b97d669c6e387f0c17f (diff)
downloadrails-8cbcd19d7079db1b5df6ddb3b813fea57cd5cc38.tar.gz
rails-8cbcd19d7079db1b5df6ddb3b813fea57cd5cc38.tar.bz2
rails-8cbcd19d7079db1b5df6ddb3b813fea57cd5cc38.zip
always return a string from find_script_name
this allows us to avoid nil checks on the return value
Diffstat (limited to 'actionpack/lib/action_dispatch/routing/route_set.rb')
-rw-r--r--actionpack/lib/action_dispatch/routing/route_set.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb
index 518d4ca09c..ce1fe2e451 100644
--- a/actionpack/lib/action_dispatch/routing/route_set.rb
+++ b/actionpack/lib/action_dispatch/routing/route_set.rb
@@ -694,7 +694,7 @@ module ActionDispatch
end
def find_script_name(options)
- options.delete :script_name
+ options.delete(:script_name) { '' }
end
# The +options+ argument must be a hash whose keys are *symbols*.
@@ -713,7 +713,7 @@ module ActionDispatch
original_script_name = options.delete(:original_script_name)
script_name = find_script_name options
- if script_name && original_script_name
+ if original_script_name
script_name = original_script_name + script_name
end