diff --git a/app/models/facilitator.rb b/app/models/facilitator.rb index e2f69a48d..392958a91 100644 --- a/app/models/facilitator.rb +++ b/app/models/facilitator.rb @@ -2,6 +2,7 @@ class Facilitator < ApplicationRecord belongs_to :created_by, class_name: "User" belongs_to :updated_by, class_name: "User" has_one :user, inverse_of: :facilitator, dependent: :nullify + has_many :bookmarks, as: :bookmarkable, dependent: :destroy has_many :sectorable_items, as: :sectorable, dependent: :destroy has_many :sectors, through: :sectorable_items has_many :stories_as_spotlighted_facilitator, inverse_of: :spotlighted_facilitator, class_name: "Story", diff --git a/app/models/project.rb b/app/models/project.rb index a78c0a35e..998081331 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -4,6 +4,7 @@ class Project < ApplicationRecord belongs_to :location, optional: true # TODO - remove Location if unused belongs_to :windows_type, optional: true has_many :addresses, as: :addressable, dependent: :destroy + has_many :bookmarks, as: :bookmarkable, dependent: :destroy has_many :project_users, dependent: :restrict_with_error has_many :users, through: :project_users has_many :reports, through: :users diff --git a/app/views/facilitators/show.html.erb b/app/views/facilitators/show.html.erb index f32b77caa..911f9f309 100644 --- a/app/views/facilitators/show.html.erb +++ b/app/views/facilitators/show.html.erb @@ -2,8 +2,11 @@