subdomainitis 0.9.1 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/subdomainitis.rb +6 -0
- metadata +2 -2
data/lib/subdomainitis.rb
CHANGED
@@ -118,6 +118,12 @@ module Subdomainitis
|
|
118
118
|
def host_name(subdomain_parameter, host)
|
119
119
|
raise HostRequired.new unless host
|
120
120
|
index = -1 - tld_length
|
121
|
+
subdomain_parameter = if subdomain_parameter.respond_to?(:to_param)
|
122
|
+
subdomain_parameter.to_param
|
123
|
+
else
|
124
|
+
subdomain_parameter
|
125
|
+
end
|
126
|
+
|
121
127
|
([subdomain_parameter] + host.split(".")[index..-1]).join(".")
|
122
128
|
end
|
123
129
|
|