Merge pull request #3130 from AndrewKvalheim/vote-cache-expiration

Expire voting fragment caches
This commit is contained in:
Henne Vogelsang 2023-04-19 13:23:05 +02:00 committed by GitHub
commit 86b8990d71
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 72 additions and 3 deletions

View file

@ -2,7 +2,7 @@
class Vote < ApplicationRecord
belongs_to :user
belongs_to :event
belongs_to :event, touch: true
validates :user_id, uniqueness: { scope: :event_id }

View file

@ -1,4 +1,4 @@
- cache ['admin', conference_id, program, event] do
- cache ['admin', conference_id, program, event, current_user] do
%tr{ id: "event-#{event.id}" }
%td
= event.id

View file

@ -1,4 +1,4 @@
- cache ['admin/event', @conference, @program, @event] do
- cache ['admin/event', @conference, @program, @event, current_user] do
.row
.col-md-12
%h3