diff --git a/lib/templates.rb b/lib/templates.rb index 26e58a3e..44ae5cae 100644 --- a/lib/templates.rb +++ b/lib/templates.rb @@ -59,6 +59,7 @@ module Templates .select(1).arel.exists Template.where(id: TemplateSharing.where(account_id: shared_account_ids).select(:template_id)) + .where(account_id: account.linked_account_account.account_id) .where.not(exists_access) end