Sha256: 588cd7dd10f293b05b54e65454a58208a79f0f3468214655933035a862e8031e

Contents?: true

Size: 393 Bytes

Versions: 6

Compression:

Stored size: 393 Bytes

Contents

class ActiveFedoraPidBasedJob
  def queue_name
    :pid_based
  end

  attr_accessor :pid
  def initialize(pid)
    self.pid = pid
  end
  def object
    @object ||= ActiveFedora::Base.find(pid, cast:true).tap{|f| f.reload_on_save = true}
  end
  alias_method :generic_file, :object
  alias_method :generic_file_id, :pid

  def run
    raise RuntimeError, "Define #run in a subclass"
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
sufia-4.0.0.beta2 sufia-models/lib/sufia/models/jobs/active_fedora_pid_based_job.rb
sufia-models-4.0.0.beta2 lib/sufia/models/jobs/active_fedora_pid_based_job.rb
sufia-4.0.0.beta1 sufia-models/lib/sufia/models/jobs/active_fedora_pid_based_job.rb
sufia-models-4.0.0.beta1 lib/sufia/models/jobs/active_fedora_pid_based_job.rb
sufia-models-3.7.2 lib/sufia/models/jobs/active_fedora_pid_based_job.rb
sufia-3.7.2 sufia-models/lib/sufia/models/jobs/active_fedora_pid_based_job.rb