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)) %>