Sha256: 8538c6834efe1edabc4fe28236569aef9191e513171ea6a61127eb5cdd9a45ee

Contents?: true

Size: 1.01 KB

Versions: 2

Compression:

Stored size: 1.01 KB

Contents

module Ddr
  module Models
    class Base < ActiveFedora::Base

      include Describable
      include Governable
      include AccessControllable
      include Licensable
      include HasProperties
      include HasThumbnail
      include ActiveFedora::Auditable
      include EventLoggable
      include FixityCheckable
      include FileManagement
      include Indexing
      include HasRoleAssignments
      include Hydra::Validations
      include HasWorkflow
      include HasPreservationMetadata

      def copy_admin_policy_or_permissions_from(other)
        copy_permissions_from(other) unless copy_admin_policy_from(other)
      end

      def association_query(association)
        # XXX Ideally we would include a clause to limit by AF model, but this should suffice
        ActiveFedora::SolrService.construct_query_for_rel(reflections[association].options[:property] => internal_uri)
      end

      # e.g., "Collection duke:1"
      def model_pid
        [self.class.to_s, pid].join(" ")
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ddr-models-1.7.0 lib/ddr/models/base.rb
ddr-models-1.6.0 lib/ddr/models/base.rb