Sha256: dd56391681b3b8869b8b0503100cbc40861bc1b757ff6293ae506768764046c8

Contents?: true

Size: 935 Bytes

Versions: 11

Compression:

Stored size: 935 Bytes

Contents

module Crm
  class Product < ::ApplicationRecord
    self.table_name = "Product"
    self.primary_key = "ProductId"

    belongs_to :price_list, foreign_key: 'PriceLevelId', crm_key: 'pricelevelid'
    belongs_to :currency, foreign_key: 'TransactionCurrencyId', crm_key: 'transactioncurrencyid'
    belongs_to :default_uom, foreign_key: 'DefaultUoMId', crm_key: 'defaultuomid', class_name: 'Crm::Uom'
    belongs_to :default_uom_schedule, foreign_key: 'DefaultUoMScheduleId', crm_key: 'defaultuomscheduleid', class_name: 'Crm::UomSchedule'

    has_many :notes, foreign_key: 'ObjectId'
    has_many :invoice_products, foreign_key: 'ProductId'
    has_many :price_list_items, foreign_key: 'ProductId'

    validates :Name, presence: true
    validates :QuantityDecimal, presence: true
    validates :ProductNumber, presence: true
    validates :default_uom, presence: true
    validates :default_uom_schedule, presence: true

  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

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