Sha256: e2c6fe7ad90fb0daa6a5645830f38faf400d3bb70673e0fcadc8f914fb31cbc1
Contents?: true
Size: 772 Bytes
Versions: 49
Compression:
Stored size: 772 Bytes
Contents
class CmsSite < ActiveRecord::Base # -- Relationships -------------------------------------------------------- has_many :cms_layouts, :dependent => :destroy has_many :cms_pages, :dependent => :destroy has_many :cms_snippets, :dependent => :destroy has_many :cms_uploads, :dependent => :destroy # -- Validations ---------------------------------------------------------- validates :label, :presence => true, :uniqueness => true validates :hostname, :presence => true, :uniqueness => true, :format => { :with => /^[\w\.\-]+$/ } # -- Class Methods -------------------------------------------------------- def self.options_for_select CmsSite.all.collect{|s| ["#{s.label} (#{s.hostname})", s.id]} end end
Version data entries
49 entries across 49 versions & 1 rubygems