Sha256: 3e62aa50f4b2f55ba649e9c38b77c18b0aba090e16066eea9e027836cc74799f

Contents?: true

Size: 997 Bytes

Versions: 7

Compression:

Stored size: 997 Bytes

Contents

module Ddr
  module Models
    class Base < ActiveFedora::Base

      include Describable
      include Governable
      include AccessControllable
      include Licensable
      include HasProperties
      include HasThumbnail
      include EventLoggable
      include FixityCheckable
      include FileManagement
      include Indexing
      include Hydra::Validations
      include HasAdminMetadata

      after_destroy do
        notify_event :deletion
      end

      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

7 entries across 7 versions & 1 rubygems

Version Path
ddr-models-1.13.2 lib/ddr/models/base.rb
ddr-models-1.13.1 lib/ddr/models/base.rb
ddr-models-1.13.0 lib/ddr/models/base.rb
ddr-models-1.12.3 lib/ddr/models/base.rb
ddr-models-1.12.2 lib/ddr/models/base.rb
ddr-models-1.12.1 lib/ddr/models/base.rb
ddr-models-1.12.0 lib/ddr/models/base.rb