Remove caching from user access modals [SCI-6163] (#3600)

This commit is contained in:
artoscinote 2021-10-22 10:03:52 +02:00 committed by GitHub
parent 35eb7bffdd
commit 0c8614c9ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 34 deletions

View file

@ -13,17 +13,13 @@
</p>
<hr />
<% users.each do |user| %>
<% user_assignment = experiment.user_assignments.find_by(user: user) %>
<% cache [user_assignment, experiment, user, current_user] do %>
<%= render partial: 'access_permissions/partials/experiment_member_field',
locals: {
user: user,
project: project,
experiment: experiment,
update_path: access_permissions_project_experiment_path(project, experiment)
} %>
<% end %>
<%= render partial: 'access_permissions/partials/experiment_member_field',
locals: {
user: user,
project: project,
experiment: experiment,
update_path: access_permissions_project_experiment_path(project, experiment)
} %>
<% end %>
</div>
<div class="modal-footer">

View file

@ -10,10 +10,7 @@
<div class="modal-body">
<% users.each do |user| %>
<% user_assignment = experiment.user_assignments.find_by(user: user) %>
<% cache [user_assignment, experiment, current_user, user] do %>
<%= render partial: 'access_permissions/partials/user_assignment', locals: { user_assignment: user_assignment, user: user, resource: experiment } %>
<% end %>
<%= render partial: 'access_permissions/partials/user_assignment', locals: { user_assignment: user_assignment, user: user, resource: experiment } %>
<% end %>
</div>
<div class="modal-footer">

View file

@ -13,18 +13,14 @@
</p>
<hr />
<% users.each do |user| %>
<% user_assignment = my_module.user_assignments.find_by(user: user) %>
<% cache [user_assignment, my_module, user, current_user] do %>
<%= render partial: 'access_permissions/partials/my_module_member_field',
locals: {
user: user,
project: project,
experiment: experiment,
my_module: my_module,
update_path: access_permissions_project_experiment_my_module_path(project, experiment, my_module)
} %>
<% end %>
<%= render partial: 'access_permissions/partials/my_module_member_field',
locals: {
user: user,
project: project,
experiment: experiment,
my_module: my_module,
update_path: access_permissions_project_experiment_my_module_path(project, experiment, my_module)
} %>
<% end %>
</div>
<div class="modal-footer">

View file

@ -10,10 +10,7 @@
<div class="modal-body">
<% users.each do |user| %>
<% user_assignment = my_module.user_assignments.find_by(user: user) %>
<% cache [user_assignment, my_module, current_user, user] do %>
<%= render partial: 'access_permissions/partials/user_assignment', locals: { user_assignment: user_assignment, user: user, resource: my_module } %>
<% end %>
<%= render partial: 'access_permissions/partials/user_assignment', locals: { user_assignment: user_assignment, user: user, resource: my_module } %>
<% end %>
</div>
<div class="modal-footer">

View file

@ -9,9 +9,7 @@
</div>
<div class="modal-body">
<% resource.user_assignments.each do |user_assignment| %>
<% cache [user_assignment, resource, current_user, user_assignment.user] do %>
<%= render partial: 'access_permissions/partials/user_assignment', locals: { user_assignment: user_assignment, user: user_assignment.user, resource: resource } %>
<% end %>
<%= render partial: 'access_permissions/partials/user_assignment', locals: { user_assignment: user_assignment, user: user_assignment.user, resource: resource } %>
<% end %>
</div>
<div class="modal-footer">