mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-27 10:08:11 +08:00
Fix issue with project dropdown caching [SCI-2783]
This commit is contained in:
parent
9fd99d9fc5
commit
641d74829a
3 changed files with 3 additions and 3 deletions
|
@ -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',
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue