aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch
diff options
context:
space:
mode:
authorDerek Watson <watson@dcw.ca>2013-04-11 22:12:19 -0400
committerAndrew White <andyw@pixeltrix.co.uk>2013-04-18 17:12:40 +0100
commit6183e1a460ccab6df1d07c3e99e98b61b2cc450b (patch)
treed585a05a0202f30b2e51d27d11e59fae20b5c320 /actionpack/lib/action_dispatch
parent296830ed0f8732c6779dcdfed0f0e3d59947e47c (diff)
downloadrails-6183e1a460ccab6df1d07c3e99e98b61b2cc450b.tar.gz
rails-6183e1a460ccab6df1d07c3e99e98b61b2cc450b.tar.bz2
rails-6183e1a460ccab6df1d07c3e99e98b61b2cc450b.zip
Passing subdomain: '' to url_for removes the subdomain (instead of adding a leading .)
Adding a boolean route constraint checks for presence/absence of request property
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r--actionpack/lib/action_dispatch/http/url.rb2
-rw-r--r--actionpack/lib/action_dispatch/journey/route.rb4
2 files changed, 5 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/http/url.rb b/actionpack/lib/action_dispatch/http/url.rb
index ab5399c8ea..e9d4cd6c34 100644
--- a/actionpack/lib/action_dispatch/http/url.rb
+++ b/actionpack/lib/action_dispatch/http/url.rb
@@ -100,7 +100,7 @@ module ActionDispatch
tld_length = options[:tld_length] || @@tld_length
host = ""
- unless options[:subdomain] == false
+ unless options[:subdomain] == false || options[:subdomain] == ''
host << (options[:subdomain] || extract_subdomain(options[:host], tld_length)).to_param
host << "."
end
diff --git a/actionpack/lib/action_dispatch/journey/route.rb b/actionpack/lib/action_dispatch/journey/route.rb
index 6fda085681..50e1853094 100644
--- a/actionpack/lib/action_dispatch/journey/route.rb
+++ b/actionpack/lib/action_dispatch/journey/route.rb
@@ -102,6 +102,10 @@ module ActionDispatch
value === request.send(method).to_s
when Array
value.include?(request.send(method))
+ when TrueClass
+ request.send(method).present?
+ when FalseClass
+ request.send(method).blank?
else
value === request.send(method)
end