Skip to content

Commit

Permalink
Explicitly add dependent option
Browse files Browse the repository at this point in the history
  • Loading branch information
Klaus Zanders committed Aug 9, 2023
1 parent 305a657 commit c36db73
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions app/models/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,22 @@ class Project < ApplicationRecord
.merge(Principal.not_locked.user)
.references(:principal, :roles)
},
as: :entity
as: :entity,
inverse_of: :entity,
dependent: nil

has_many :memberships,
class_name: 'Member',
as: :entity
as: :entity,
dependent: nil

has_many :member_principals,
-> { not_locked },
class_name: 'Member',
as: :entity
as: :entity,
inverse_of: :entity,
dependent: nil

has_many :users, through: :members, source: :principal
has_many :principals, through: :member_principals, source: :principal

Expand Down

0 comments on commit c36db73

Please sign in to comment.