Sha256: 689f3d8e24a4028c41cba5bee9bacaa77a1c12a377e2d4b102ba21399f63f9a2

Contents?: true

Size: 492 Bytes

Versions: 1

Compression:

Stored size: 492 Bytes

Contents

# frozen_string_literal: true

module ActiveFedora
  module Noid
    # Mix this class into an ActiveFedora:Base model in order to have you new objects
    # created with a noid id.
    module Model
      ## This overrides the default behavior, which is to ask Fedora for an id
      # @see ActiveFedora::Persistence.assign_id
      def assign_id
        service.mint
      end

      private

      def service
        @service ||= ActiveFedora::Noid::Service.new
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
active_fedora-noid-2.2.0 lib/active_fedora/noid/model.rb