diff --git a/lib/sf/contact.rb b/lib/sf/contact.rb index 8c255f1..f17880a 100644 --- a/lib/sf/contact.rb +++ b/lib/sf/contact.rb @@ -161,9 +161,9 @@ def self.board_of_trustees_as_of(date=nil) from = 'Seat__c' date ||= Date.today date = date.strftime('%Y-%m-%d') - where = "Committee__r.Name = 'BOT (Board of Trustees)' and - Start_Date__c <= #{date} and Actual_End_Date__c >= #{date} and - Contact__c <> null" + where = "Committee__r.Name = 'BOT (Board of Trustees)' and Start_Date__c <= #{date} and + ((Actual_End_Date__c = null and Term_End_Date__c >= #{date}) or Actual_End_Date__c >= #{date}) + and Contact__c <> null" build_contacts(from, where) end