Module: SubdomainFu::RouteExtensions

Defined in:
lib/subdomain_fu/routing_extensions.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



7
8
9
# File 'lib/subdomain_fu/routing_extensions.rb', line 7

def self.included(base)
  base.alias_method_chain :recognition_conditions, :subdomain
end

Instance Method Details

#recognition_conditions_with_subdomainObject



11
12
13
14
15
16
17
# File 'lib/subdomain_fu/routing_extensions.rb', line 11

def recognition_conditions_with_subdomain
  result = recognition_conditions_without_subdomain
  result << "conditions[:subdomain] === env[:subdomain]" if conditions[:subdomain] && conditions[:subdomain] != true && conditions[:subdomain] != false
  result << "SubdomainFu.has_subdomain?(env[:subdomain])" if conditions[:subdomain] == true
  result << "!SubdomainFu.has_subdomain?(env[:subdomain])" if conditions[:subdomain] == false
  result
end