Permalink
Browse files

not removing expired members from mailchimp

  • Loading branch information...
1 parent 7717a6f commit 89010ab300d071376ed5af73544a9ef7278fb47c @fguillen committed Oct 12, 2012
Showing with 6 additions and 3 deletions.
  1. +2 −0 TODO.md
  2. +2 −1 app/models/member.rb
  3. +2 −2 test/unit/lib/gibbon_wrapper_test.rb
View
2 TODO.md
@@ -84,6 +84,8 @@ X Static Pages: how to pay, how to renew
X HistoryEvents with tag "front", "admin", ...
- HistoryEvents: filtro por etiquetas
+- Mailchimp sync return summary..
+- Mailchimp sync attend to errors in remove or update..
X Cuando recuperas la contraseña en el último punto se queda colgado diciendo que tienes que estar autenticado!
View
3 app/models/member.rb
@@ -68,7 +68,8 @@ class Member < ActiveRecord::Base
validates_uniqueness_of :card_code, :allow_nil => true
validates_uniqueness_of :dni, :allow_nil => true
- scope :mail_chimp_compatible, where( "members.email is not null and members.membership_until > ?", Time.now.to_date )
+ # scope :mail_chimp_compatible, where( "members.email is not null and members.membership_until > ?", Time.now.to_date )
+ scope :mail_chimp_compatible, where( "members.email is not null" )
def full_name
"#{name} #{surname}"
View
4 test/unit/lib/gibbon_wrapper_test.rb
@@ -14,9 +14,9 @@ def test_members
member_1 = FactoryGirl.create( :member, :email => "email1@email.com", :membership_until => Time.now + 1.months )
member_2 = FactoryGirl.create( :member, :email => nil, :membership_until => Time.now + 1.months )
member_3 = FactoryGirl.create( :member, :email => "email3@email.com", :membership_until => Time.now - 1.months )
- member_3 = FactoryGirl.create( :member, :email => "email3@email.com", :membership_until => nil )
+ member_4 = FactoryGirl.create( :member, :email => "email3@email.com", :membership_until => nil )
- assert_equal( [member_1.id], GibbonWrapper.members.map( &:id ) )
+ assert_equal( [member_1.id, member_3.id, member_4.id], GibbonWrapper.members.map( &:id ) )
end
def test_remove_not_actual_members

0 comments on commit 89010ab

Please sign in to comment.