Sha256: 026e84934099ce5a2b0616d399867cd0ef8975f585b9c6bc52b9c2001428144b
Contents?: true
Size: 608 Bytes
Versions: 11
Compression:
Stored size: 608 Bytes
Contents
module Crm class Case < ::ApplicationRecord self.table_name = "Incident" self.primary_key = "IncidentId" belongs_to :contact, foreign_key: 'ContactId', crm_key: 'customerid_contact' belongs_to :account, foreign_key: 'AccountId', crm_key: 'customerid_account' has_many :notes, foreign_key: 'ObjectId', class_name: "Crm::CaseNote" validates :Title, presence: true validate :contact_xor_account private def contact_xor_account unless contact.blank? ^ account.blank? errors.add(:base, "Specify a contact or account, not both") end end end end
Version data entries
11 entries across 11 versions & 1 rubygems