Adopt Rails 5 belongs_to_required_by_default

This commit is contained in:
Patrick Gansterer 2020-08-01 02:49:15 +02:00
parent 2557645f4f
commit 44a198c7bc
23 changed files with 53 additions and 38 deletions

View file

@ -5,11 +5,11 @@ class GroupOrder < ApplicationRecord
attr_accessor :group_order_articles_attributes
belongs_to :order
belongs_to :ordergroup
belongs_to :ordergroup, optional: true
has_many :group_order_articles, :dependent => :destroy
has_many :order_articles, :through => :group_order_articles
has_one :financial_transaction
belongs_to :updated_by, :class_name => "User", :foreign_key => "updated_by_user_id"
belongs_to :updated_by, optional: true, class_name: 'User', foreign_key: 'updated_by_user_id'
validates_presence_of :order_id
validates_numericality_of :price