forked from Internet2-TSG/sf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
174 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| class Sf::RegMeetingOptionAssociation | ||
| include Sf::Base | ||
|
|
||
| def initialize(reg_meeting_option_association=nil) | ||
| @reg_meeting_option_association = reg_meeting_option_association.nil? ? Restforce::SObject.new(sobject_type: 'RegMeetingOptionAssociation__c') : reg_meeting_option_association | ||
| end | ||
|
|
||
| def method_missing(method_name, *args, &block) | ||
| @reg_meeting_option_association.send(method_name, *args, &block) | ||
| end | ||
|
|
||
| def respond_to_missing?(method_name, include_private = false) | ||
| @reg_meeting_option_association.respond_to?(method_name, include_private) || super | ||
| end | ||
|
|
||
| def update(attrs = {}) | ||
| attrs['Id'] = self.Id | ||
| Sf.client.update("RegMeetingOptionAssociation__c", attrs) | ||
| end | ||
|
|
||
| def self.find(id) | ||
| new Sf.client.find("RegMeetingOptionAssociation__c", id) | ||
| end | ||
|
|
||
| def self.find_by_code(code) | ||
| found_meeting = where({code__c: code}).first | ||
| new Sf.client.find("RegMeetingOptionAssociation__c", found_meeting.Id) unless found_meeting.nil? | ||
| end | ||
|
|
||
| def self.find_all_by_event_id(event_id) | ||
| found_meeting_options = where({reg_event_id__c: event_id}) | ||
| meeting_options = found_meeting_options.map do |meeting_option| | ||
| Sf.client.find("RegMeetingOptionAssociation__c", meeting_option.Id) unless meeting_option.nil? | ||
| end | ||
| build_collection meeting_options | ||
| end | ||
|
|
||
| def self.where(args = {}) | ||
| where = args.map {|k,v| "#{k} = \'#{v}\'"}.join(" and ") | ||
| sobjects = Sf.client.query("select Id, Name from RegMeetingOptionAssociation__c where #{where}") | ||
| build_collection sobjects unless sobjects.blank? | ||
| end | ||
|
|
||
| def self.find_all_by_meeting_id(meeting_id) | ||
| found_meeting_options = where({reg_meeting_id__c: meeting_id}) | ||
| meeting_options = found_meeting_options.map do |meeting_option| | ||
| Sf.client.find("RegMeetingOptionAssociation__c", meeting_option.Id) unless meeting_option.nil? | ||
| end | ||
| build_collection meeting_options | ||
| end | ||
|
|
||
| end | ||
|
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| class Sf::RegOption | ||
| include Sf::Base | ||
|
|
||
| def initialize(reg_option=nil) | ||
| @reg_option = reg_option.nil? ? Restforce::SObject.new(sobject_type: 'RegOption__c') : reg_option | ||
| end | ||
|
|
||
| def method_missing(method_name, *args, &block) | ||
| @reg_option.send(method_name, *args, &block) | ||
| end | ||
|
|
||
| def respond_to_missing?(method_name, include_private = false) | ||
| @reg_option.respond_to?(method_name, include_private) || super | ||
| end | ||
|
|
||
| def update(attrs = {}) | ||
| attrs['Id'] = self.Id | ||
| Sf.client.update("RegOption__c", attrs) | ||
| end | ||
|
|
||
| def self.find(id) | ||
| new Sf.client.find("RegOption__c", id) | ||
| end | ||
|
|
||
| def self.find_by_code(code) | ||
| found_option = where({code__c: code}).first | ||
| new Sf.client.find("RegOption__c", found_option.Id) unless found_option.nil? | ||
| end | ||
|
|
||
| def self.find_all_by_meeting_id(meeting_id) | ||
| found_meeting_options = Sf::RegMeetingOptionAssociation.find_all_by_meeting_id(meeting_id) | ||
| found_option_ids = found_meeting_options.map(&:reg_option_id__c) | ||
| options = found_option_ids.compact.map do |option_id| | ||
| Sf.client.find("RegOption__c", option_id) | ||
| end | ||
| build_collection options | ||
| end | ||
|
|
||
| def self.find_all_by_event_id(event_id) | ||
| found_option = where({reg_event_id__c: event_id}) | ||
| option = found_option.map do |option| | ||
| Sf.client.find("RegOption__c", option.Id) unless option.nil? | ||
| end | ||
| build_collection option | ||
| end | ||
|
|
||
| def self.where(args = {}) | ||
| where = args.map {|k,v| "#{k} = \'#{v}\'"}.join(" and ") | ||
| sobjects = Sf.client.query("select Id, Name from RegOption__c where #{where}") | ||
| build_collection sobjects unless sobjects.blank? | ||
| end | ||
|
|
||
| end | ||
|
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| class Sf::RegRate | ||
| include Sf::Base | ||
|
|
||
| def initialize(reg_rate=nil) | ||
| @reg_rate = reg_rate.nil? ? Restforce::SObject.new(sobject_type: 'RegRate__c') : reg_rate | ||
| end | ||
|
|
||
| def method_missing(method_name, *args, &block) | ||
| @reg_rate.send(method_name, *args, &block) | ||
| end | ||
|
|
||
| def respond_to_missing?(method_name, include_private = false) | ||
| @reg_rate.respond_to?(method_name, include_private) || super | ||
| end | ||
|
|
||
| def update(attrs = {}) | ||
| attrs['Id'] = self.Id | ||
| Sf.client.update!("RegRate__c", attrs) | ||
| end | ||
|
|
||
| def self.find(id) | ||
| new Sf.client.find("RegRate__c", id) | ||
| end | ||
|
|
||
| def self.find_by_code(code) | ||
| found_rate = where({code__c: code}).first | ||
| new Sf.client.find("RegRate__c", found_rate.Id) unless found_rate.nil? | ||
| end | ||
|
|
||
| def self.find_all_by_meeting_id(meeting_id) | ||
| found_rates = where({reg_meeting_id__c: meeting_id}) | ||
| rates = found_rates.map do |rate| | ||
| Sf.client.find("RegRate__c", rate.Id) unless rate.nil? | ||
| end | ||
| build_collection rates | ||
| end | ||
|
|
||
| def self.where(args = {}) | ||
| where = args.map {|k,v| "#{k} = \'#{v}\'"}.join(" and ") | ||
| sobjects = Sf.client.query("select Id, Name from RegRate__c where #{where}") | ||
| build_collection sobjects unless sobjects.blank? | ||
| end | ||
|
|
||
| end | ||
|
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| module Sf | ||
| VERSION = "0.1.17" | ||
| VERSION = "0.1.18" | ||
| end |