Class: GeoConcerns::Actors::FileActor

Inherits:
CurationConcerns::Actors::FileActor
  • Object
show all
Defined in:
app/actors/geo_concerns/actors/file_actor.rb

Instance Method Summary collapse

Instance Method Details

#ingest_file(file) ⇒ Object



4
5
6
7
8
9
10
# File 'app/actors/geo_concerns/actors/file_actor.rb', line 4

def ingest_file(file)
  IngestFileJob.perform_later(file_set,
                              working_file(file),
                              user,
                              ingest_options(file))
  true
end

#mime_type(file) ⇒ String

Determines the correct mime type for a file. If the mime type is stored on the file_set (set in the view), then use that value. If not, use the file content type, if it exists.

Parameters:

  • file (File, ActionDigest::HTTP::UploadedFile)

    to get mime type from

Returns:

  • (String)

    Mime type for the file



17
18
19
20
# File 'app/actors/geo_concerns/actors/file_actor.rb', line 17

def mime_type(file)
  return file_set.geo_mime_type if file_set.geo_mime_type
  file.respond_to?(:content_type) ? file.content_type : nil || file_set.geo_mime_type
end