Sha256: ac89dbceb776ca9f5978b319053c50e82159887ae83fe32e37b89c76bc78d9d6

Contents?: true

Size: 722 Bytes

Versions: 42

Compression:

Stored size: 722 Bytes

Contents

class Caboose::Site < ActiveRecord::Base
  self.table_name = "sites"
       
  has_many :site_memberships, :class_name => 'Caboose::SiteMembership', :dependent => :delete_all
  has_many :domains, :class_name => 'Caboose::Domain', :dependent => :delete_all
  has_many :post_categories, :class_name => 'Caboose::PostCategory'
  attr_accessible :id, :name, :description, :under_construction_html
  
  def smtp_config
    c = Caboose::SmtpConfig.where(:site_id => self.id).first
  end
  
  def self.id_for_domain(domain)
    d = Caboose::Domain.where(:domain => domain).first
    return nil if d.nil?
    return d.site_id
  end
  
  def self.sanitize_name(name)
    self.name = self.name.downcase.gsub(' ', '_')
  end
  
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
caboose-cms-0.5.15 app/models/caboose/site.rb
caboose-cms-0.5.14 app/models/caboose/site.rb
caboose-cms-0.5.13 app/models/caboose/site.rb
caboose-cms-0.5.12 app/models/caboose/site.rb
caboose-cms-0.5.11 app/models/caboose/site.rb
caboose-cms-0.5.10 app/models/caboose/site.rb
caboose-cms-0.5.9 app/models/caboose/site.rb
caboose-cms-0.5.8 app/models/caboose/site.rb
caboose-cms-0.5.7 app/models/caboose/site.rb
caboose-cms-0.5.6 app/models/caboose/site.rb
caboose-cms-0.5.5 app/models/caboose/site.rb
caboose-cms-0.5.4 app/models/caboose/site.rb
caboose-cms-0.5.3 app/models/caboose/site.rb
caboose-cms-0.5.2 app/models/caboose/site.rb
caboose-cms-0.5.1 app/models/caboose/site.rb
caboose-cms-0.4.151 app/models/caboose/site.rb
caboose-cms-0.4.150 app/models/caboose/site.rb
caboose-cms-0.4.149 app/models/caboose/site.rb
caboose-cms-0.4.148 app/models/caboose/site.rb
caboose-cms-0.4.147 app/models/caboose/site.rb