Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
reformatted reg_meeting_option_association.rb, no changes
ij committed Jun 30, 2022
1 parent f66ec9e commit 369124c
Showing 1 changed file with 42 additions and 40 deletions.
82 changes: 42 additions & 40 deletions lib/sf/reg_meeting_option_association.rb
@@ -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

0 comments on commit 369124c

Please sign in to comment.