From 641d74829a74d31a6b7dd5f749d76f3bad98a07c Mon Sep 17 00:00:00 2001 From: Oleksii Kriuchykhin Date: Wed, 24 Oct 2018 17:52:40 +0200 Subject: [PATCH] Fix issue with project dropdown caching [SCI-2783] --- app/models/user_project.rb | 2 +- app/views/projects/index/_project_actions_dropdown.html.erb | 2 +- app/views/projects/index/_team_projects.html.erb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/user_project.rb b/app/models/user_project.rb index 05c551fef..62498f7d4 100644 --- a/app/models/user_project.rb +++ b/app/models/user_project.rb @@ -5,7 +5,7 @@ class UserProject < ApplicationRecord validates :user, presence: true validates :project, presence: true - belongs_to :user, inverse_of: :user_projects, optional: true + belongs_to :user, inverse_of: :user_projects, touch: true, optional: true belongs_to :assigned_by, foreign_key: 'assigned_by_id', class_name: 'User', diff --git a/app/views/projects/index/_project_actions_dropdown.html.erb b/app/views/projects/index/_project_actions_dropdown.html.erb index 0a1c5e763..da042b1b7 100644 --- a/app/views/projects/index/_project_actions_dropdown.html.erb +++ b/app/views/projects/index/_project_actions_dropdown.html.erb @@ -1,4 +1,4 @@ -<% cache project do %> +<% cache [current_user, project] do %> <% active = !project.archived %> <% if (active && (can_manage_project?(project) || can_archive_project?(project))) || (!active && can_restore_project?(project)) %>