Sha256: a0b680b00638396d4e4c2bd97d3868c5b30c3ad55d1e0bb36263cc9d2d7834bf

Contents?: true

Size: 994 Bytes

Versions: 3

Compression:

Stored size: 994 Bytes

Contents

require Sufia::Engine.root.join('app/models/generic_file')
require File.expand_path("../curation_concern/with_access_right", __FILE__)
require File.expand_path("../curation_concern/embargoable", __FILE__)
require File.expand_path("../../repository_datastreams/file_content_datastream", __FILE__)

class GenericFile
  include CurationConcern::WithAccessRight
  include CurationConcern::Embargoable

  belongs_to :batch, property: :is_part_of, class_name: 'ActiveFedora::Base'

  validates :batch, presence: true
  validates :file, presence: true, on: :create

  class_attribute :human_readable_short_description
  self.human_readable_short_description = "An arbitrary single file."

  attr_accessor :file, :version

  def filename
    content.label
  end

  def to_s
    title || label || "No Title"
  end

  def versions
    content.versions
  end

  def current_version_id
    content.latest_version.versionID
  end

  def human_readable_type
    self.class.to_s.demodulize.titleize
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
curate-0.3.2 app/repository_models/generic_file.rb
curate-0.3.1 app/repository_models/generic_file.rb
curate-0.2.0 app/repository_models/generic_file.rb