Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fixed invalid query to Salesforce when there is no record
ij committed Jun 4, 2016
1 parent 7c4d612 commit 33bca90
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions lib/sf/account.rb
@@ -100,8 +100,12 @@ def self.inc_parts_to_be

def self.inc_certs_to_be
acct_ids = Sf::Opportunity.cert_subscribers(Date.today.prev_month(2)).map(&:AccountId)
accts_str = acct_ids.map{|v| "\'#{v}\'"}.join(', ')
build_collection Sf.client.query("select #{FIELDS_SELECT_STR} from Account where InCommon_Participant__c = true and Id in (#{accts_str})")
if acct_ids.empty?
[]
else
accts_str = acct_ids.map{|v| "\'#{v}\'"}.join(', ')
build_collection Sf.client.query("select #{FIELDS_SELECT_STR} from Account where InCommon_Participant__c = true and Id in (#{accts_str})")
end
end

def self.active_inc_parts(service_name)
2 changes: 1 addition & 1 deletion lib/sf/version.rb
@@ -1,3 +1,3 @@
module Sf
VERSION = "0.1.34"
VERSION = "0.1.35"
end

0 comments on commit 33bca90

Please sign in to comment.