Module: Refinery::SiteModel::ClassMethods

Defined in:
lib/refinerycms-multisite.rb

Instance Method Summary collapse

Instance Method Details

#find_by_hostname(hostname) ⇒ Object



37
38
39
40
# File 'lib/refinerycms-multisite.rb', line 37

def find_by_hostname(hostname)
  Site.joins(:hostnames).where(:hostnames=>{:hostname=>hostname}).first ||
    Site.joins(:hostnames).where(:hostnames=>{:hostname=>'*'}).first
end