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

@@ -12,7 +12,7 @@ class Image < ApplicationRecord
hash_secret: Rails.application.secrets.secret_key_base
belongs_to :user
belongs_to :imageable, polymorphic: true
belongs_to :imageable, polymorphic: true, touch: true
validates :title, presence: true
validate :validate_title_length