Class: Handcart::Subdomain
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Handcart::Subdomain
- Defined in:
- app/models/handcart/subdomain.rb
Class Method Summary collapse
Class Method Details
.matches?(request) ⇒ Boolean
18 19 20 21 22 23 24 25 26 27 28 |
# File 'app/models/handcart/subdomain.rb', line 18 def self.matches?(request) my_subdomain = Subdomain.find_by_name(request.subdomain) if my_subdomain && request.subdomain.present? && !Handcart.reserved_subdomains.include?(request.subdomain) && my_subdomain.handcart if my_subdomain.handcart.respond_to?(:active?) my_subdomain.handcart.active? else # Just default to true since we found the record true end end end |