Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
added RegEvent#active_since
ij committed Oct 11, 2022
1 parent 56cc729 commit 339235e
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 7 additions & 1 deletion lib/sf/reg_event.rb
@@ -50,7 +50,13 @@ def self.by_codes(codes = [])

def self.active_since_past_year
year_ago = Time.now.years_ago(1).iso8601
where = "status__c = 'active' and end_date__c > #{year_ago}"
active_since(year_ago)
end

def self.active_since(date)
return [] if date.nil?

where = "status__c = 'active' and end_date__c > #{date}"
sobjects = Sf.client.query("select #{FIELDS_SELECT_STR} from RegEvent__c where #{where}")
sobjects.blank? ? [] : build_collection(sobjects)
end
4 changes: 3 additions & 1 deletion lib/sf/version.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Sf
VERSION = "0.1.71"
VERSION = '0.1.72'
end

0 comments on commit 339235e

Please sign in to comment.