Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
added cert_service_subscribers
ij committed Aug 20, 2020
1 parent 984b393 commit 25a3d7e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lib/sf/account.rb
@@ -130,6 +130,22 @@ def self.active_inc_parts(service_name)
build_collection sobjects.map(&:Supporting_Institution__r) unless sobjects.blank?
end

def self.cert_service_subscribers
today = Date.today.strftime('%Y-%m-%d')
sobjects = Sf.client.query("select
Supporting_Institution__r.Id,
Supporting_Institution__r.Name,
Supporting_Institution__r.InCommon_Website_Name__c,
Supporting_Institution__r.InCommon_Participant_Type__c,
Supporting_Institution__r.InCommon_Weblink__c
from Service_Institution__c where Service__r.Name = \'InCommon Certificate Service\'
and (Service_End_Date__c = null or Service_End_Date__c > #{today})
and (Service_Start_Date__c = null or Service_Start_Date__c < #{today})
and (Type_of_Support__c = 'Subscriber' or Type_of_Support__c = 'Subscriber Parent')
and Do_Not_Publish__c <> true")
build_collection sobjects.map(&:Supporting_Institution__r) unless sobjects.blank?
end

private

def subscriptions

0 comments on commit 25a3d7e

Please sign in to comment.