Sha256: 43b3971f49c4519a5a5233d4428d0bd20272b4cf1e0340831fb65d3cec212d31

Contents?: true

Size: 562 Bytes

Versions: 3

Compression:

Stored size: 562 Bytes

Contents

# frozen_string_literal: true

module GeoblacklightAdmin
  class SetParentDctReferencesUriJob < ApplicationJob
    queue_as :priority

    def perform(asset)
      if asset.dct_references_uri_key.present?
        reference = Document::Reference.new
        reference.category = asset.dct_references_uri_key
        reference.value = asset.full_file_url
        asset.parent.dct_references_s << reference
        asset.parent.save!
      end
    rescue => e
      Rails.logger.error "\nError - Setting parent DCT references URI: #{e.message}\n"
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
geoblacklight_admin-0.5.1 app/jobs/geoblacklight_admin/set_parent_dct_references_uri_job.rb
geoblacklight_admin-0.5.0 app/jobs/geoblacklight_admin/set_parent_dct_references_uri_job.rb
geoblacklight_admin-0.4.2 app/jobs/geoblacklight_admin/set_parent_dct_references_uri_job.rb