Class: StoreItemAudit
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- StoreItemAudit
- Defined in:
- app/models/store_item_audit.rb
Overview
== Schema Information
Table name: store_item_audits
Database name: primary
id :integer not null, primary key
entered_at :datetime
new_qty_on_hand :integer
new_unit_cogs :decimal(10, 4)
old_qty_on_hand :integer
old_unit_cogs :decimal(10, 4)
operation :string(255)
item_ledger_entry_id :integer
store_item_id :integer
Indexes
idx_store_item_id_entered_at (store_item_id,entered_at)
index_store_item_audits_on_entered_at (entered_at) USING brin
index_store_item_audits_on_item_ledger_entry_id (item_ledger_entry_id)
Foreign Keys
fk_rails_... (item_ledger_entry_id => item_ledger_entries.id) ON DELETE => cascade
fk_rails_... (store_item_id => store_items.id) ON DELETE => cascade
Belongs to collapse
Methods inherited from ApplicationRecord
ransackable_associations, ransackable_attributes, ransackable_scopes, ransortable_attributes, #to_relation
Methods included from Models::EventPublishable
Instance Method Details
#item_ledger_entry ⇒ ItemLedgerEntry
29 |
# File 'app/models/store_item_audit.rb', line 29 belongs_to :item_ledger_entry, optional: true |