Make StockEvent a base class for Delivery and StockTaking
This helps to share code between the two entities and allows easier extensions in the future.
This commit is contained in:
parent
a5582e9542
commit
785313ac23
9 changed files with 69 additions and 33 deletions
|
|
@ -1,7 +1,7 @@
|
|||
class StockChange < ApplicationRecord
|
||||
belongs_to :delivery
|
||||
belongs_to :delivery, foreign_key: 'stock_event_id'
|
||||
belongs_to :order
|
||||
belongs_to :stock_taking
|
||||
belongs_to :stock_taking, foreign_key: 'stock_event_id'
|
||||
belongs_to :stock_article
|
||||
|
||||
validates_presence_of :stock_article_id, :quantity
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue