Skip to content

Commit

Permalink
updated membership query
Browse files Browse the repository at this point in the history
  • Loading branch information
ij committed Jul 6, 2015
1 parent c48e696 commit b202b8d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/sf/account.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class Sf::Account
include Sf::Base

FIELDS = ['Id', 'Name', 'Member_Type__c', 'Member_Category__c', 'Member_Join_Date__c', 'Status__c', 'Website', 'InCommon_Participant__c', 'iMIS_ID__c']
FIELDS = ['Id', 'Name', 'Member_Type__c', 'Member_Category__c', 'Member_Join_Date__c', 'Status__c', 'Website', 'InCommon_Participant__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(', ')
Expand Down Expand Up @@ -49,7 +49,7 @@ def self.intl_partners
end

def self.members
build_collection Sf.client.query("select #{FIELDS_SELECT_STR} from Account where Member_Type__c IN (#{MEMBER_TYPES_STR}) order by Name")
build_collection Sf.client.query("select #{FIELDS_SELECT_STR} from Account where Membership_Status__c = true and Status__c = 'Active' order by Name")
end

def self.all
Expand All @@ -60,7 +60,7 @@ def self.community_orgs
build_collection Sf.client.query(
"select #{FIELDS_SELECT_STR} from Account
where Name='Internet2' or InCommon_Participant__c = true
or Member_Type__c IN (#{MEMBER_TYPES_STR})
or (Membership_Status__c = true and Status__c = 'Active')
or Member_Category__c = 'International Partner'
order by Name"
)
Expand Down
2 changes: 1 addition & 1 deletion lib/sf/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Sf
VERSION = "0.1.25"
VERSION = "0.1.26"
end

0 comments on commit b202b8d

Please sign in to comment.