Browse files

Delegate subdomain method to the URL module, removing duplication

  • Loading branch information...
1 parent 47d8fc0 commit 034bf727190489a9f4cf3643c39b76709d0e0644 @carlosantoniodasilva carlosantoniodasilva committed Jan 12, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 actionpack/lib/action_dispatch/http/url.rb
View
2 actionpack/lib/action_dispatch/http/url.rb
@@ -169,7 +169,7 @@ def subdomains(tld_length = @@tld_length)
# such as 2 to catch <tt>"www"</tt> instead of <tt>"www.rubyonrails"</tt>
# in "www.rubyonrails.co.uk".
def subdomain(tld_length = @@tld_length)
- subdomains(tld_length).join(".")
+ ActionDispatch::Http::URL.extract_subdomain(host, tld_length)
end
end
end

0 comments on commit 034bf72

Please sign in to comment.