add specs
This commit is contained in:
parent
e902aa0d5a
commit
45db0575b1
46 changed files with 714 additions and 238 deletions
|
|
@ -1,8 +1,10 @@
|
|||
class MultiGroupOrder < ApplicationRecord
|
||||
belongs_to :multi_order
|
||||
has_many :group_orders
|
||||
belongs_to :multi_order, optional: false
|
||||
has_many :group_orders, dependent: :nullify
|
||||
has_one :ordergroup_invoice, dependent: :destroy
|
||||
|
||||
validates :multi_order, presence: true
|
||||
|
||||
def ordergroup
|
||||
group_orders.first&.ordergroup
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue