Permalink
Browse files

set defaults to avoid errors on creation

  • Loading branch information...
1 parent 4bd04ce commit d56ec5d9bbdddabf1f8e3fffb3d8cc1405c3d607 @will-r will-r committed Nov 22, 2011
Showing with 8 additions and 1 deletion.
  1. +7 −0 app/models/mailing_list_membership.rb
  2. +1 −1 lib/radiant-reader_mailman-extension.rb
@@ -2,6 +2,7 @@ class MailingListMembership < ActiveRecord::Base
establish_connection "mailman_#{RAILS_ENV}"
set_table_name Radiant.config['reader.mailman.list_name']
set_primary_key "address"
+ before_create :set_defaults
def self.of_list(listname)
old_table_name = self.table_name
@@ -24,6 +25,12 @@ def self.of_list(listname)
private
+ def set_defaults
+ self.bi_lastnotice = 0
+ self.bi_date = 0
+ self.ack = true
+ end
+
def to_yesno(value)
(value && value.to_i != 0) ? 'Y' : 'N'
end
@@ -1,5 +1,5 @@
module RadiantReaderMailmanExtension
- VERSION = '0.1.1'
+ VERSION = '0.1.2'
SUMMARY = %q{Basic integration of reader groups with mailman mailing lists}
DESCRIPTION = %q{Allows you to specify and configure a mailman mailing list for your readers. Group lists will follow.}
URL = "http://radiant.spanner.org/reader_mailman"

0 comments on commit d56ec5d

Please sign in to comment.