Add created_by user to Task

This commit is contained in:
Patrick Gansterer 2020-03-06 13:04:03 +01:00
parent 18e38be6be
commit b6f5295267
10 changed files with 35 additions and 7 deletions

View file

@ -4,6 +4,7 @@ class Task < ApplicationRecord
has_many :users, :through => :assignments
belongs_to :workgroup
belongs_to :periodic_task_group
belongs_to :created_by, :class_name => 'User', :foreign_key => 'created_by_user_id'
scope :non_group, -> { where(workgroup_id: nil, done: false) }
scope :done, -> { where(done: true) }