Skip to content
This repository
Browse code

Delegate subdomain method to the URL module, removing duplication

  • Loading branch information...
commit 034bf727190489a9f4cf3643c39b76709d0e0644 1 parent 47d8fc0
Carlos Antonio da Silva carlosantoniodasilva authored

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. +1 1  actionpack/lib/action_dispatch/http/url.rb
2  actionpack/lib/action_dispatch/http/url.rb
@@ -169,7 +169,7 @@ def subdomains(tld_length = @@tld_length)
169 169 # such as 2 to catch <tt>"www"</tt> instead of <tt>"www.rubyonrails"</tt>
170 170 # in "www.rubyonrails.co.uk".
171 171 def subdomain(tld_length = @@tld_length)
172   - subdomains(tld_length).join(".")
  172 + ActionDispatch::Http::URL.extract_subdomain(host, tld_length)
173 173 end
174 174 end
175 175 end

0 comments on commit 034bf72

Please sign in to comment.
Something went wrong with that request. Please try again.