|
|
|
@ -2,7 +2,7 @@ class Organisation < ApplicationRecord |
|
|
|
has_many :users, dependent: :delete_all |
|
|
|
has_many :users, dependent: :delete_all |
|
|
|
has_many :data_protection_officers, -> { where(is_dpo: true) }, class_name: "User" |
|
|
|
has_many :data_protection_officers, -> { where(is_dpo: true) }, class_name: "User" |
|
|
|
has_one :data_protection_confirmation |
|
|
|
has_one :data_protection_confirmation |
|
|
|
has_many :organisation_rent_periods |
|
|
|
has_many :organisation_rent_periods, dependent: :destroy |
|
|
|
has_many :owned_schemes, class_name: "Scheme", foreign_key: "owning_organisation_id", dependent: :delete_all |
|
|
|
has_many :owned_schemes, class_name: "Scheme", foreign_key: "owning_organisation_id", dependent: :delete_all |
|
|
|
has_many :parent_organisation_relationships, foreign_key: :child_organisation_id, class_name: "OrganisationRelationship" |
|
|
|
has_many :parent_organisation_relationships, foreign_key: :child_organisation_id, class_name: "OrganisationRelationship" |
|
|
|
has_many :parent_organisations, through: :parent_organisation_relationships |
|
|
|
has_many :parent_organisations, through: :parent_organisation_relationships |
|
|
|
|