Sha256: a24c0ae73b5ee23eb0fc90deb98f97b0d60f6c7e83b4def9f9886791ee79a434

Contents?: true

Size: 749 Bytes

Versions: 11

Compression:

Stored size: 749 Bytes

Contents

module Crm
  class Opportunity < ::ApplicationRecord
    self.table_name = "Opportunity"
    self.primary_key = "OpportunityId"

    belongs_to :campaign, foreign_key: 'CampaignId', crm_key: 'campaignid'
    belongs_to :account, foreign_key: 'AccountId', crm_key: 'customerid_account'
    belongs_to :contact, foreign_key: 'ContactId', crm_key: 'customerid_contact'
    belongs_to :parent_account, foreign_key: 'ParentAccountId', crm_key: 'parentaccountid', class_name: 'Crm::Account'
    belongs_to :parent_contact, foreign_key: 'ParentContactId', crm_key: 'parentcontactid', class_name: 'Crm::Contact'

    has_many :invoices, foreign_key: 'OpportunityId'
    has_many :notes, foreign_key: 'ObjectId', class_name: "Crm::OpportunityNote"

  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
activerecord_sqlserver_crm-5.1.3 app/models/crm/opportunity.rb
activerecord_sqlserver_crm-5.1.2 app/models/crm/opportunity.rb
activerecord_sqlserver_crm-5.1.1 app/models/crm/opportunity.rb
activerecord_sqlserver_crm-5.0.7 app/models/crm/opportunity.rb
activerecord_sqlserver_crm-5.0.6 app/models/crm/opportunity.rb
activerecord_sqlserver_crm-5.1.0 app/models/crm/opportunity.rb
activerecord_sqlserver_crm-5.0.5 app/models/crm/opportunity.rb
activerecord_sqlserver_crm-5.0.4 app/models/crm/opportunity.rb
activerecord_sqlserver_crm-5.0.3 app/models/crm/opportunity.rb
activerecord_sqlserver_crm-5.0.2 app/models/crm/opportunity.rb
activerecord_sqlserver_crm-5.0.1 app/models/crm/opportunity.rb