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

@ -2,7 +2,7 @@ class PrinterJob < ActiveRecord::Base
belongs_to :order
belongs_to :created_by, class_name: 'User', foreign_key: 'created_by_user_id'
belongs_to :finished_by, class_name: 'User', foreign_key: 'finished_by_user_id'
belongs_to :finished_by, optional: true, class_name: 'User', foreign_key: 'finished_by_user_id'
has_many :printer_job_updates
scope :finished, -> { where.not(finished_at: nil) }