Sha256: e202ddacae746cbc866544ba93a3d626a887816ceacd72d6027f30ee31646d74

Contents?: true

Size: 751 Bytes

Versions: 1

Compression:

Stored size: 751 Bytes

Contents

# frozen_string_literal: true

# ImportDocumentDistribution class
class ImportDocumentDistribution < ApplicationRecord
  has_many :import_document_distribution_transitions, autosave: false, dependent: :destroy

  include Statesman::Adapters::ActiveRecordQueries[
    transition_class: ImportDocumentDistributionTransition,
    initial_state: :queued
  ]

  def state_machine
    @state_machine ||= ImportDocumentDistributionStateMachine.new(self, transition_class: ImportDocumentDistributionTransition)
  end

  def to_hash
    {
      friendlier_id: friendlier_id,
      reference_type: ReferenceType.find_by(name: reference_type),
      url: distribution_url,
      label: label,
      import_distribution_id: import_distribution_id
    }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
geoblacklight_admin-0.7.0 app/models/import_document_distribution.rb