Module: DataRelationships
- Included in:
- SoqlData
- Defined in:
- lib/leap_salesforce/soql_data/data_relationships.rb
Overview
Represents common relationships from a Data class
Instance Method Summary collapse
-
#organisation ⇒ Object
Retrieve organisation related to current opportunity.
-
#owner ⇒ Exchange
Object representing owner of object.
-
#queue ⇒ Exchange
Object representing owner of object.
-
#record_type ⇒ Object
Retrieve record type for current object.
Instance Method Details
#organisation ⇒ Object
Retrieve organisation related to current opportunity
9 10 11 12 13 |
# File 'lib/leap_salesforce/soql_data/data_relationships.rb', line 9 def organisation raise '"Organisation" class not yet defined' unless defined? Organisation Organisation.find(Id: self['AccountId']) end |
#owner ⇒ Exchange
Returns object representing owner of object.
18 19 20 |
# File 'lib/leap_salesforce/soql_data/data_relationships.rb', line 18 def owner User.find(Id: self[:owner_id]) end |
#queue ⇒ Exchange
Returns object representing owner of object.
25 26 27 |
# File 'lib/leap_salesforce/soql_data/data_relationships.rb', line 25 def queue Group.find(Id: self[:owner_id]) end |
#record_type ⇒ Object
Retrieve record type for current object
30 31 32 33 34 |
# File 'lib/leap_salesforce/soql_data/data_relationships.rb', line 30 def record_type raise '"RecordType" class not yet defined' unless defined? RecordType RecordType.find(Id: self['RecordTypeId']) end |