Class: GeoblacklightAdmin::RemoveParentDctReferencesUriJob

Inherits:
ApplicationJob
  • Object
show all
Defined in:
app/jobs/geoblacklight_admin/remove_parent_dct_references_uri_job.rb

Instance Method Summary collapse

Instance Method Details

#perform(asset) ⇒ Object



7
8
9
10
11
12
13
14
# File 'app/jobs/geoblacklight_admin/remove_parent_dct_references_uri_job.rb', line 7

def perform(asset)
  if asset.dct_references_uri_key.present?
    asset.parent.dct_references_s.delete_if { |i| i.value == asset.full_file_url }
    asset.parent.save!
  end
rescue => e
  Rails.logger.error "\nError - Removing parent dct_references URI: #{e.message} \n"
end