mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-28 02:27:57 +08:00
Hound is Love, Hound is Life
This commit is contained in:
parent
91cddce8a6
commit
8d68769d09
1 changed files with 3 additions and 3 deletions
|
@ -669,9 +669,9 @@ class Protocol < ApplicationRecord
|
|||
|
||||
def update_linked_children
|
||||
# Increment/decrement the parent's nr of linked children
|
||||
if self.saved_change_to_parent_id?
|
||||
if self.parent_id_before_last_save != nil
|
||||
p = Protocol.find_by_id(self.parent_id_before_last_save)
|
||||
if saved_change_to_parent_id?
|
||||
unless parent_id_before_last_save.nil?
|
||||
p = Protocol.find_by_id(parent_id_before_last_save)
|
||||
p.record_timestamps = false
|
||||
p.decrement!(:nr_of_linked_children)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue