Adopt Rails 5 belongs_to_required_by_default
This commit is contained in:
parent
2557645f4f
commit
44a198c7bc
23 changed files with 53 additions and 38 deletions
|
|
@ -2,8 +2,8 @@
|
|||
class Task < ApplicationRecord
|
||||
has_many :assignments, :dependent => :destroy
|
||||
has_many :users, :through => :assignments
|
||||
belongs_to :workgroup
|
||||
belongs_to :periodic_task_group
|
||||
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'
|
||||
|
||||
scope :non_group, -> { where(workgroup_id: nil, done: false) }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue