app/models/component.rb in ddr-models-2.4.7 vs app/models/component.rb in ddr-models-2.4.8
- old
+ new
@@ -10,17 +10,23 @@
include Ddr::Models::HasStructMetadata
belongs_to :parent, :property => :is_part_of, :class_name => 'Item'
belongs_to :target, :property => :has_external_target, :class_name => 'Target'
+ after_save :index_parent, if: :has_extracted_text?, unless: "parent.nil?"
+
alias_method :item, :parent
alias_method :item=, :parent=
def collection
self.parent.parent rescue nil
end
def collection_uri
self.collection.internal_uri rescue nil
+ end
+
+ def index_parent
+ Resque.enqueue(Ddr::Jobs::UpdateIndex, parent_id)
end
end