Class: MailinglistClass

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.get_param_description(param, html = false) ⇒ Object



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'app/models/mailinglist_class.rb', line 56

def self.get_param_description(param, html = false)    
    case param
    when 'public'
        param_desc = "Whether the list is open to the public or not.\nIf checked, anyone can post to the list.\nIf unchecked, only members of the mailing list can post to it."
    when 'closed'
        param_desc = "Determines who can send mail to the mailing list.\nIf checked, only the owner can send mail.\nIf unchecked, other people can post to it as determined by the \"Public\" parameter."
    when 'moderated'
        param_desc = "Determines if the owner has to approve every message posted to the mailing list.\nIf checked, all posted messages go to owner first.\nIf unchecked, all posted messages are sent to the list immediately."
    when 'confirmation'
        param_desc = "Determines whether a newly subscribed address requires subscription-confirmation from the user (via e-mail).\nIf checked, subscriptions have to be confirmed by the subscriber.\nIf unchecked, subscriptions will happen automatically."
    when 'joinable'
        param_desc = "Determines whether the general public can join this mailinglist.\nIf checked, anyone can subscribe to the list at will by sending email to _listname_-request@_domain_.\nIf unchecked, then only the owner can subscribe/unsubscribe people."
    when 'archived'
        param_desc = "Determines whether the messages are retained after delivery.\nIf checked, then messages are archived (useful for viewing online archives).\nIf unchecked, then messages are discarded after delivery (recommended for the mail-forwarding feature, for privacy concerns)."
    else
        param_desc = "'" + param.to_s + "' is not a valid mailing class parameter"
    end
  
    if html then
        param_desc.gsub!(/\n/, '<br/>')
    end
  
    return param_desc
end

.get_param_namesObject



52
53
54
# File 'app/models/mailinglist_class.rb', line 52

def self.get_param_names
    return %w{public closed moderated confirmation joinable archived}
end

Instance Method Details

#before_destroyObject



44
45
46
47
48
# File 'app/models/mailinglist_class.rb', line 44

def before_destroy
    if ml = Mailinglist.find_by_mailinglist_class_id(self.id)
        raise MlClassInUseException
    end
end