From 29d13c0c11d8a9fa9cf86393c7f9f0285004640d Mon Sep 17 00:00:00 2001 From: p31729568 Date: Tue, 30 Jul 2019 16:08:02 +0800 Subject: [PATCH] modify tiding identifier func --- app/models/tiding.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/models/tiding.rb b/app/models/tiding.rb index 3ef625c57..90abdf809 100644 --- a/app/models/tiding.rb +++ b/app/models/tiding.rb @@ -13,9 +13,14 @@ class Tiding < ApplicationRecord value = container.try(:identifier) end + if value.blank? && parent_container_type && Object.const_defined?(parent_container_type) + value = parent_container_type.try(:identifier) + end + if value.blank? && belong_container_type && Object.const_defined?(belong_container_type) value = belong_container.try(:identifier) end + value end end \ No newline at end of file