Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
added the formuala field InCommon_Participation__c for query active I…
…nC participants
ij committed Jul 12, 2017
1 parent 9e9cc47 commit 6038f09
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions lib/sf/account.rb
@@ -1,7 +1,7 @@
class Sf::Account
include Sf::Base

FIELDS = ['Id', 'Name', 'Member_Type__c', 'Member_Category__c', 'MOU_Participant__c', 'Member_Join_Date__c', 'Status__c', 'Website', 'InCommon_Participant__c', 'iMIS_ID__c', 'Membership_Status__c']
FIELDS = ['Id', 'Name', 'Member_Type__c', 'Member_Category__c', 'MOU_Participant__c', 'Member_Join_Date__c', 'Status__c', 'Website', 'InCommon_Participant__c', 'InCommon_Participation__c', 'iMIS_ID__c', 'Membership_Status__c']
FIELDS_SELECT_STR = FIELDS.join(', ')
MEMBER_TYPES = ['R&E Network Member', 'University Member', 'Industry Member', 'Affiliate Member']
MEMBER_TYPES_STR = MEMBER_TYPES.map{|v| "\'#{v}\'"}.join(', ')
@@ -110,16 +110,16 @@ def self.inc_certs_to_be

def self.active_inc_parts(service_name)
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 = \'#{service_name}\'
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 Do_Not_Publish__c <> true")
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 = \'#{service_name}\'
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 Do_Not_Publish__c <> true")
build_collection sobjects.map(&:Supporting_Institution__r) unless sobjects.blank?
end
end
end

0 comments on commit 6038f09

Please sign in to comment.