This is the table that handle the attachments. You can define some global info like:
attachment_styles :thumb, "128x128"
In this way all models that use has_one_attachment or has_many_attachments handle a default style called thumb
Remember that any model that use has_one_attachment or has_many_attachments can override/add styles/validations etc…
Methods
Public Instance methods
Perform file.destroy
[ show source ]
# File lib/data_base/attachment_table.rb, line 75
75: def destroy_attached_files
76: logger.info("[Attachment] Deleting attachments.")
77: file.queue_existing_for_delete
78: file.flush_deletes
79: end
Returns a Lipsiadmin::Attachment::Attach instance
[ show source ]
# File lib/data_base/attachment_table.rb, line 39
39: def file
40: @_file ||= Lipsiadmin::Attachment::Attach.new(:attached, self, attachment_definitions)
41: end
Assign a Lipsiadmin::Attachment::Attach instance to the current file
[ show source ]
# File lib/data_base/attachment_table.rb, line 44
44: def file=(tempfile)
45: file.assign(tempfile)
46: end
Returns true if the file exist
[ show source ]
# File lib/data_base/attachment_table.rb, line 49
49: def file?
50: file.exist?
51: end
Perform file.save
[ show source ]
# File lib/data_base/attachment_table.rb, line 69
69: def save_attached_files
70: logger.info("[Attachment] Saving attachments.")
71: file.save
72: end
[ show source ]
# File lib/data_base/attachment_table.rb, line 34
34: def url(style=nil)
35: file.url(style)
36: end