]> nos-oignons.net Git - gestion-adh.git/blobdiff - bin/list-emails
Finish implenting update-ag-subscribers
[gestion-adh.git] / bin / list-emails
index 4c8a286f627792b0e12b0b64520abd8c2c7c9eb0..6b13304b764262dd851848b068d1b879cff43c97 100755 (executable)
@@ -7,11 +7,8 @@ Bundler.setup
 
 require 'nos_oignons/subscriptions'
 
-subscriptions = read_subscriptions
-now = Time.now
-last_year = Time.new(now.year - 1, now.month, now.day).to_date
-subscriptions.each_pair do |subscription_id, data|
-  if data['membership_fee_paid_on'] && last_year < data['membership_fee_paid_on']
-    puts data['email']
+NosOignons::Subscription.all.each do |subscription|
+  if subscription.up_to_date?
+    puts subscription.email
   end
 end