Skip to content

Commit

Permalink
removed nil error when there is no participants to be
Browse files Browse the repository at this point in the history
  • Loading branch information
ij committed Sep 3, 2015
1 parent b202b8d commit 3a5ea33
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions lib/sf/account.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,12 @@ def self.intl_partner?(account_id)
# It looks up for the past one year
def self.inc_parts_to_be
acct_ids = Sf::Opportunity.inc_participations(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.inc_certs_to_be
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.26"
VERSION = "0.1.27"
end

0 comments on commit 3a5ea33

Please sign in to comment.