Prevent relationable models from being cached

This commit is contained in:
María Checa
2017-12-18 22:25:22 +01:00
parent 4b181ead28
commit 8d7509917c

View File

@@ -4,8 +4,8 @@ class RelatedContent < ActiveRecord::Base
RELATED_CONTENTS_REPORT_THRESHOLD = Setting['related_contents_report_threshold'].to_i
RELATIONABLE_MODELS = %w{proposals debates}.freeze
belongs_to :parent_relationable, polymorphic: true
belongs_to :child_relationable, polymorphic: true
belongs_to :parent_relationable, polymorphic: true, touch: true
belongs_to :child_relationable, polymorphic: true, touch: true
has_one :opposite_related_content, class_name: 'RelatedContent', foreign_key: :related_content_id
validates :parent_relationable_id, presence: true