Sha256: 1f824a9376d3e90aea09fffd3a6c80353dda4687fd4be8a430766728b1f8ac13
Contents?: true
Size: 1013 Bytes
Versions: 11
Compression:
Stored size: 1013 Bytes
Contents
=begin rdoc Author:: Chris Hauboldt (mailto:biz@lnstar.com) Copyright:: 2009 Lone Star Internet Inc. MailingList simply defines the available lists for subscriptions in the system. See Subscription for more information. =end module MailManager class MailingList < ActiveRecord::Base self.table_name = "#{MailManager.table_prefix}mailing_lists" # associations get stupid when ActiveRecord is scoped for some horrible reason has_many :subscriptions, :class_name => 'MailManager::Subscription' has_and_belongs_to_many :mailings, :class_name => 'MailManager::Mailing', :join_table => "#{MailManager.table_prefix}mailing_lists_#{MailManager.table_prefix}mailings" scope :active, {:conditions => {:status => 'active',:deleted_at => nil}} validates :name, presence: true include StatusHistory before_create :set_default_status attr_protected :id def active? deleted_at.nil? end def inactive? !active? end end end
Version data entries
11 entries across 11 versions & 1 rubygems