Fix issue with project dropdown caching [SCI-2783]

This commit is contained in:
Oleksii Kriuchykhin 2018-10-24 17:52:40 +02:00
parent 9fd99d9fc5
commit 641d74829a
3 changed files with 3 additions and 3 deletions

View file

@ -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',

View file

@ -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)) %>
<div class="dropdown pull-right">

View file

@ -1,7 +1,7 @@
<div class="row">
<% projects.each_with_index do |project, i| %>
<div class="col-lg-3 col-md-4 col-sm-6 col-xs-12">
<% cache project do %>
<% cache [current_user, project] do %>
<%= render partial: "projects/index/project.html.erb", locals: { project: project } %>
<% end %>
</div>