Expire cache when adding documents and images

Proposals and budget investments were not correctly updated when adding,
removing or modifying their documents and images.
This commit is contained in:
Javi Martín
2021-09-14 16:40:33 +02:00
parent 288ae13958
commit f7b83319c6
4 changed files with 10 additions and 3 deletions

View File

@@ -7,7 +7,7 @@ class Document < ApplicationRecord
hash_secret: Rails.application.secrets.secret_key_base
belongs_to :user
belongs_to :documentable, polymorphic: true
belongs_to :documentable, polymorphic: true, touch: true
validates :title, presence: true
validates :user_id, presence: true