Sha256: e383dd138fe6a6447f144655d0b7c1134650cb9c46a27d8e008366885a367f1b
Contents?: true
Size: 578 Bytes
Versions: 14
Compression:
Stored size: 578 Bytes
Contents
module Crm class Case < ActiveRecord::Base 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' 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
14 entries across 14 versions & 1 rubygems