Adopt Rails 5 belongs_to_required_by_default
This commit is contained in:
parent
2557645f4f
commit
44a198c7bc
23 changed files with 53 additions and 38 deletions
|
|
@ -1,7 +1,7 @@
|
|||
class StockChange < ApplicationRecord
|
||||
belongs_to :delivery, foreign_key: 'stock_event_id'
|
||||
belongs_to :order
|
||||
belongs_to :stock_taking, foreign_key: 'stock_event_id'
|
||||
belongs_to :delivery, optional: true, foreign_key: 'stock_event_id'
|
||||
belongs_to :order, optional: true
|
||||
belongs_to :stock_taking, optional: true, 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