Sha256: 98fe49312a40765c42b83502c05fc5f4b709008cba3c33d326b55a4cdf8a58d1
Contents?: true
Size: 901 Bytes
Versions: 50
Compression:
Stored size: 901 Bytes
Contents
module ActiveFedora module RDF # # Mixin for adding datastream persistence to an ActiveTriples::Resource # descendant so that it may be used to back an ActiveFedora::RDFDatastream. # # @see ActiveFedora::RDFDatastream.resource_class # @see ActiveFedora::RDF::ObjectResource # module Persistence extend ActiveSupport::Concern BASE_URI = 'info:fedora/'.freeze included do configure base_uri: BASE_URI unless base_uri attr_accessor :datastream end # Overrides ActiveTriples::Resource def persist! return false unless datastream && datastream.respond_to?(:save) @persisted ||= datastream.save end # Overrides ActiveTriples::Resource def persisted? return true if frozen? && !datastream.new_record? @persisted ||= !datastream.new_record? end end end end
Version data entries
50 entries across 50 versions & 1 rubygems