From 82e18d3932030e30166ab7e21a3a04b888bf6edb Mon Sep 17 00:00:00 2001 From: Andrej Date: Mon, 10 Mar 2025 09:29:36 +0100 Subject: [PATCH] Do not touch parent of table if there is no changes on table [SCI-11633] --- app/models/table.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/models/table.rb b/app/models/table.rb index 54f53485a..2f80a3c9b 100644 --- a/app/models/table.rb +++ b/app/models/table.rb @@ -21,14 +21,13 @@ class Table < ApplicationRecord optional: true belongs_to :team, optional: true has_one :step_table, inverse_of: :table, dependent: :destroy - has_one :step, through: :step_table + has_one :step, through: :step_table, touch: true has_one :result_table, inverse_of: :table, dependent: :destroy - has_one :result, through: :result_table + has_one :result, through: :result_table, touch: true has_many :report_elements, inverse_of: :table, dependent: :destroy after_save :update_ts_index - after_save { result&.touch; step&.touch } def metadata attributes['metadata'].is_a?(String) ? JSON.parse(attributes['metadata']) : attributes['metadata']