Class: UploadedFile

Inherits:
ApplicationRecord
  • Object
show all
Includes:
Checkable, HasOwner, HasTrack, HasUuid
Defined in:
app/models/uploaded_file.rb

Overview

Uploaded file

Attributes:

attachment [SimpleFileUploader]
agent_id [Agent], optional
biovision_component_id [BiovisionComponent]
checksum [String]
created_at [DateTime]
data [jsonb]
description [String], optional
ip_address_id [IpAddress], optional
object_count [Integer]
updated_at [DateTime]
user_id [User], optional
uuid [uuid]

Constant Summary collapse

META_LIMIT =
255

Class Method Summary collapse

Instance Method Summary collapse

Methods included from HasOwner

#owned_by?, #owner_name

Class Method Details

.entity_parametersObject



43
44
45
# File 'app/models/uploaded_file.rb', line 43

def self.entity_parameters
  %i[attachment description]
end

Instance Method Details

#file_sizeObject



51
52
53
# File 'app/models/uploaded_file.rb', line 51

def file_size
  File.size(attachment.path)
end

#nameObject



47
48
49
# File 'app/models/uploaded_file.rb', line 47

def name
  File.basename(attachment.path)
end