module ActiveFedora::WithMetadata
This builds classes for metadata nodes (nodes that describe a binary)
These are the default properties defined on a resource that has WithMetadata
added to it. This is most commonly used with ActiveFedora::File
, when we want to add rdf triples to a non-rdf resource and have them persisted.
Public Instance Methods
create_or_update(*)
click to toggle source
Calls superclass method
# File lib/active_fedora/with_metadata.rb, line 21 def create_or_update(*) return unless super && !new_record? # TODOs captured as https://github.com/samvera/active_fedora/issues/1331 metadata_node.metadata_uri = described_by # TODO: only necessary if the URI was < > before metadata_node.save # TODO: if changed? end
metadata_node()
click to toggle source
# File lib/active_fedora/with_metadata.rb, line 17 def metadata_node @metadata_node ||= self.class.metadata_schema.new(self) end