class Item

An Item is a member of a Collection – i.e., a “work” – the principal describable resource.

Examples: photograph, book, article, sound recording, video, etc.

Public Instance Methods

all_text() click to toggle source
# File app/models/item.rb, line 33
def all_text
  children_having_extracted_text.docs.map(&:extracted_text).flatten
end
children_having_extracted_text() click to toggle source
# File app/models/item.rb, line 24
def children_having_extracted_text
  item = self
  Ddr::Index::Query.new do
    is_part_of item
    where attached_files_having_content: "extractedText"
    fields :id, :extracted_text
  end
end
publishable?() click to toggle source
# File app/models/item.rb, line 20
def publishable?
  parent.present? && parent.published?
end