Sha256: 0491d8f6d72a5a3397158b6bf7b2d63d3ab03c1efa338771f56bc06a9e99285f

Contents?: true

Size: 549 Bytes

Versions: 15

Compression:

Stored size: 549 Bytes

Contents

# frozen_string_literal: true

module Bulkrax
  class ImporterRun < ApplicationRecord
    belongs_to :importer
    has_many :statuses, as: :runnable, dependent: :destroy
    has_many :pending_relationships, dependent: :destroy

    def parents
      pending_relationships.pluck(:parent_id).uniq
    end

    def user
      # An importer might not have a user, the CLI ingest need not assign a user.  As such, we
      # fallback to the configured user.
      importer.user || Bulkrax.fallback_user_for_importer_exporter_processing
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
bulkrax-8.1.0 app/models/bulkrax/importer_run.rb
bulkrax-8.0.0 app/models/bulkrax/importer_run.rb
bulkrax-7.0.0 app/models/bulkrax/importer_run.rb
bulkrax-5.5.1 app/models/bulkrax/importer_run.rb
bulkrax-5.4.2 app/models/bulkrax/importer_run.rb
bulkrax-5.3.1 app/models/bulkrax/importer_run.rb
bulkrax-6.0.1 app/models/bulkrax/importer_run.rb
bulkrax-6.0.0 app/models/bulkrax/importer_run.rb
bulkrax-5.5.0 app/models/bulkrax/importer_run.rb
bulkrax-5.4.1 app/models/bulkrax/importer_run.rb
bulkrax-5.4.0 app/models/bulkrax/importer_run.rb
bulkrax-5.3.0 app/models/bulkrax/importer_run.rb
bulkrax-5.2.1 app/models/bulkrax/importer_run.rb
bulkrax-5.2.0 app/models/bulkrax/importer_run.rb
bulkrax-5.1.0 app/models/bulkrax/importer_run.rb