Fixed cached user lists when changing assignments [SCI-6137] (#3597)

Fixed cache invalidation for assignables, current_user missing in cache keys [SCI-6137]
This commit is contained in:
artoscinote 2021-10-19 16:00:52 +02:00 committed by GitHub
parent c63090da8c
commit 3746332c30
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View file

@ -1,7 +1,7 @@
# frozen_string_literal: true
class UserAssignment < ApplicationRecord
belongs_to :assignable, polymorphic: true
belongs_to :assignable, polymorphic: true, touch: true
belongs_to :user_role
belongs_to :user
belongs_to :assigned_by, class_name: 'User', optional: true

View file

@ -15,7 +15,7 @@
<% users.each do |user| %>
<% user_assignment = experiment.user_assignments.find_by(user: user) %>
<% cache [user_assignment, experiment, user] do %>
<% cache [user_assignment, experiment, user, current_user] do %>
<%= render partial: 'access_permissions/partials/experiment_member_field',
locals: {
user: user,

View file

@ -15,7 +15,7 @@
<% users.each do |user| %>
<% user_assignment = my_module.user_assignments.find_by(user: user) %>
<% cache [user_assignment, my_module, user] do %>
<% cache [user_assignment, my_module, user, current_user] do %>
<%= render partial: 'access_permissions/partials/my_module_member_field',
locals: {
user: user,