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
8
app/models/stock_event.rb
Normal file
8
app/models/stock_event.rb
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
class StockEvent < ApplicationRecord
|
||||
|
||||
has_many :stock_changes, dependent: :destroy
|
||||
has_many :stock_articles, through: :stock_changes
|
||||
|
||||
validates_presence_of :date
|
||||
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue