Class: Hyrax::UploadedFile

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/hyrax/uploaded_file.rb

Overview

Store a file uploaded by a user.

Eventually these files get attached to FileSets and pushed into Fedora.

Instance Method Summary collapse

Instance Method Details

#add_file_set!(file_set) ⇒ void

This method returns an undefined value.

Associate a FileSet with this uploaded file.

Parameters:


22
23
24
25
26
27
28
29
30
# File 'app/models/hyrax/uploaded_file.rb', line 22

def add_file_set!(file_set)
  uri = case file_set
        when ActiveFedora::Base
          file_set.uri
        when Hyrax::Resource
          file_set.id
        end
  update!(file_set_uri: uri)
end