Add team and user_group assignment relations [SCI-12204]

This commit is contained in:
Martin Artnik 2025-08-06 15:03:03 +02:00
parent 01867fff19
commit 84b796756f
2 changed files with 2 additions and 0 deletions

View file

@ -61,6 +61,7 @@ class Team < ApplicationRecord
has_many :shareable_links, inverse_of: :team, dependent: :destroy
has_many :storage_locations, dependent: :destroy
has_many :forms, dependent: :destroy
has_many :team_assignments, dependent: :destroy
attr_accessor :without_templates

View file

@ -14,6 +14,7 @@ class UserGroup < ApplicationRecord
belongs_to :last_modified_by, class_name: 'User', optional: true
has_many :user_group_memberships, dependent: :destroy
has_many :users, through: :user_group_memberships, dependent: :destroy
has_many :user_group_assignments, dependent: :destroy
accepts_nested_attributes_for :user_group_memberships