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
destroy_attached_files()

Perform file.destroy

    # 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
file()

Returns a Lipsiadmin::Attachment::Attach instance

    # File lib/data_base/attachment_table.rb, line 39
39:       def file
40:         @_file ||= Lipsiadmin::Attachment::Attach.new(:attached, self, attachment_definitions)
41:       end
file=(tempfile)

Assign a Lipsiadmin::Attachment::Attach instance to the current file

    # File lib/data_base/attachment_table.rb, line 44
44:       def file=(tempfile)
45:         file.assign(tempfile)
46:       end
file?()

Returns true if the file exist

    # File lib/data_base/attachment_table.rb, line 49
49:       def file?
50:         file.exist?
51:       end
save_attached_files()

Perform file.save

    # 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
url(style=nil)

Returns the url of the attachment, optionally you can pass the style like url(:thumb)

    # File lib/data_base/attachment_table.rb, line 34
34:       def url(style=nil)
35:         file.url(style)
36:       end