lib/ddr/models/solr_document.rb in ddr-models-1.13.2 vs lib/ddr/models/solr_document.rb in ddr-models-1.14.0
- old
+ new
@@ -16,18 +16,22 @@
def safe_id
id.sub(/:/, "-")
end
+ def local_id
+ get(Ddr::IndexFields::LOCAL_ID)
+ end
+
def active_fedora_model
get(Ddr::IndexFields::ACTIVE_FEDORA_MODEL)
end
def internal_uri
get(Ddr::IndexFields::INTERNAL_URI)
end
-
+
def object_profile
@object_profile ||= get_json(Ddr::IndexFields::OBJECT_PROFILE)
end
def object_state
@@ -109,11 +113,11 @@
end
def source
get(ActiveFedora::SolrService.solr_name(:source, :stored_searchable, type: :text))
end
-
+
def has_thumbnail?
has_datastream?(Ddr::Datastreams::THUMBNAIL)
end
def has_content?
@@ -135,30 +139,30 @@
end
def content_size_human
get(Ddr::IndexFields::CONTENT_SIZE_HUMAN)
end
-
+
def content_checksum
content_ds["dsChecksum"] rescue nil
end
-
+
def targets
@targets ||= ActiveFedora::SolrService.query(targets_query)
end
def targets_count
@targets_count ||= ActiveFedora::SolrService.count(targets_query)
end
-
+
def has_target?
targets_count > 0
end
-
+
def has_default_rights?
has_datastream?(Ddr::Datastreams::DEFAULT_RIGHTS)
end
-
+
def association(name)
get_pid(ActiveFedora::SolrService.solr_name(name, :symbol))
end
def controller_name