mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-08 14:15:35 +08:00
Do not touch parent of table if there is no changes on table [SCI-11633]
This commit is contained in:
parent
570a90927d
commit
82e18d3932
1 changed files with 2 additions and 3 deletions
|
@ -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']
|
||||
|
|
Loading…
Add table
Reference in a new issue