Sha256: a17a0c45b7b67928ed31bbddfd077f3a13ef53ee2bba3a0906a49dafb7762af5
Contents?: true
Size: 1.02 KB
Versions: 4
Compression:
Stored size: 1.02 KB
Contents
module ActiveFedora module WithMetadata extend ActiveSupport::Concern extend ActiveSupport::Autoload autoload :MetadataNode autoload :SweetJPLTerms autoload :DefaultStrategy autoload :DefaultSchema autoload :DefaultMetadataClassFactory included do class_attribute :metadata_class_factory self.metadata_class_factory = DefaultMetadataClassFactory end def metadata_node @metadata_node ||= self.class.metadata_schema.new(self) end 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 module ClassMethods def metadata(&block) @metadata_schema = metadata_class_factory.build(self, &block) end def metadata_schema @metadata_schema ||= metadata_class_factory.build(self) end end end end
Version data entries
4 entries across 4 versions & 1 rubygems