Class: Caboose::Site

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/caboose/site.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.id_for_domain(domain) ⇒ Object



21
22
23
24
25
# File 'app/models/caboose/site.rb', line 21

def self.id_for_domain(domain)
  d = Caboose::Domain.where(:domain => domain).first
  return nil if d.nil?
  return d.site_id
end

.sanitize_name(name) ⇒ Object



27
28
29
# File 'app/models/caboose/site.rb', line 27

def self.sanitize_name(name)
  self.name = self.name.downcase.gsub(' ', '_')
end

Instance Method Details

#primary_domainObject



31
32
33
# File 'app/models/caboose/site.rb', line 31

def primary_domain
  Caboose::Domain.where(:site_id => self.id, :primary => true).first
end

#smtp_configObject



13
14
15
# File 'app/models/caboose/site.rb', line 13

def smtp_config
  c = Caboose::SmtpConfig.where(:site_id => self.id).first
end

#social_configObject



17
18
19
# File 'app/models/caboose/site.rb', line 17

def social_config
  s = Caboose::SocialConfig.where(:site_id => self.id).first
end