Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
reformatted reg_meeting_option_association.rb, no changes
Showing
1 changed file
with
42 additions
and
40 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,55 @@ | ||
class Sf::RegMeetingOptionAssociation | ||
include Sf::Base | ||
# frozen_string_literal: true | ||
|
||
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 | ||
module Sf | ||
class RegMeetingOptionAssociation | ||
include Sf::Base | ||
|
||
def method_missing(method_name, *args, &block) | ||
@reg_meeting_option_association.send(method_name, *args, &block) | ||
end | ||
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 respond_to_missing?(method_name, include_private = false) | ||
@reg_meeting_option_association.respond_to?(method_name, include_private) || super | ||
end | ||
def method_missing(method_name, *args, &block) | ||
@reg_meeting_option_association.send(method_name, *args, &block) | ||
end | ||
|
||
def update(attrs = {}) | ||
attrs['Id'] = self.Id | ||
Sf.client.update("RegMeetingOptionAssociation__c", attrs) | ||
end | ||
def respond_to_missing?(method_name, include_private = false) | ||
@reg_meeting_option_association.respond_to?(method_name, include_private) || super | ||
end | ||
|
||
def self.find(id) | ||
new Sf.client.find("RegMeetingOptionAssociation__c", id) | ||
end | ||
def update(attrs = {}) | ||
attrs['Id'] = self.Id | ||
Sf.client.update('RegMeetingOptionAssociation__c', attrs) | ||
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(id) | ||
new Sf.client.find('RegMeetingOptionAssociation__c', id) | ||
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? | ||
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 | ||
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_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.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? | ||
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 | ||
build_collection meeting_options | ||
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 | ||
end | ||
|