Sha256: c07704017c165d7197e4a03d5a432b74b4278a8943bf4bbc08beac3dc400395f

Contents?: true

Size: 740 Bytes

Versions: 3

Compression:

Stored size: 740 Bytes

Contents

# frozen_string_literal: true
# Log a fileset attachment to activity streams
class FileSetAttachedEventJob < ContentEventJob
  # Log the event to the fileset's and its container's streams
  def log_event(repo_object)
    repo_object.log_event(event)
    curation_concern.log_event(event)
  end

  def action
    "User #{link_to_profile depositor} has attached #{file_link} to #{work_link}"
  end

  private

  def file_link
    link_to file_title, polymorphic_path(repo_object)
  end

  def work_link
    link_to work_title, polymorphic_path(curation_concern)
  end

  def file_title
    repo_object.title.first
  end

  def work_title
    curation_concern.title.first
  end

  def curation_concern
    repo_object.in_works.first
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
hyrax-3.0.0.pre.rc4 app/jobs/file_set_attached_event_job.rb
hyrax-3.0.0.pre.rc3 app/jobs/file_set_attached_event_job.rb
hyrax-3.0.0.pre.rc2 app/jobs/file_set_attached_event_job.rb