From d63ec9f927ceac9be322fc53c57dd5ea1dbe7661 Mon Sep 17 00:00:00 2001 From: Alex Kriuchykhin Date: Thu, 31 Aug 2023 11:48:35 +0200 Subject: [PATCH] Fix shareable links association on user model [SCI-9200] (#6114) --- app/models/user.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index ccef0f6e2..20f003fb1 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -303,7 +303,10 @@ class User < ApplicationRecord foreign_key: 'last_modified_by_id', inverse_of: :last_modified_by, dependent: :nullify - has_many :shareable_links, inverse_of: :created_by, dependent: :destroy + has_many :shareable_links, + foreign_key: 'created_by_id', + inverse_of: :created_by, + dependent: :destroy has_many :user_notifications, inverse_of: :user has_many :notifications, through: :user_notifications