Class UploadedFile
In: app/models/uploaded_file.rb
Parent: Article

Article type that handles uploaded files.

Limitation: only file metadata are versioned. Only the latest version of the file itself is kept. (FIXME?)

Methods

External Aliases

filename= -> orig_set_filename

Public Class methods

[Source]

    # File app/models/uploaded_file.rb, line 34
34:   def self.description
35:     _('Upload any kind of file you want.')
36:   end

[Source]

    # File app/models/uploaded_file.rb, line 16
16:   def self.max_size
17:     UploadedFile.attachment_options[:max_size]
18:   end

[Source]

    # File app/models/uploaded_file.rb, line 30
30:   def self.short_description
31:     _("Uploaded file")
32:   end

Public Instance methods

[Source]

    # File app/models/uploaded_file.rb, line 48
48:   def allow_children?
49:     false
50:   end

[Source]

    # File app/models/uploaded_file.rb, line 44
44:   def data
45:     File.read(self.full_filename)
46:   end

[Source]

    # File app/models/uploaded_file.rb, line 39
39:   def filename=(value)
40:     orig_set_filename(value)
41:     self.name = self.filename
42:   end

[Source]

    # File app/models/uploaded_file.rb, line 22
22:   def icon_name
23:     self.image? ? public_filename(:icon) : self.content_type.gsub('/', '-')
24:   end

[Source]

    # File app/models/uploaded_file.rb, line 26
26:   def mime_type
27:     content_type
28:   end

[Validate]