Make user in Task model optional to support old database entries
This commit is contained in:
parent
78c4ebcb4b
commit
beaca7d384
1 changed files with 1 additions and 1 deletions
|
@ -4,7 +4,7 @@ class Task < ApplicationRecord
|
|||
has_many :users, :through => :assignments
|
||||
belongs_to :workgroup, optional: true
|
||||
belongs_to :periodic_task_group, optional: true
|
||||
belongs_to :created_by, :class_name => 'User', :foreign_key => 'created_by_user_id'
|
||||
belongs_to :created_by, :class_name => 'User', :foreign_key => 'created_by_user_id', optional: true
|
||||
|
||||
scope :non_group, -> { where(workgroup_id: nil, done: false) }
|
||||
scope :done, -> { where(done: true) }
|
||||
|
|
Loading…
Reference in a new issue