module Shrine::Plugins::Column::AttacherMethods

Defined in:

shrine/plugins/column.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(column_serializer = self.class.shrine_class.plugin_settings.column[:column_serializer], **options) #

Allows overriding the default column serializer.


[View source]

Instance Method Detail

def column_data : String? #

Returns attacher data as a serialized string (JSON by default).

attacher.column_data #=> '{"id":"...","storage":"...","metadata":{...}}'

[View source]
def column_serializer : Shrine::Plugins::Column::BaseSerializer.class #

Column serializer object.


[View source]
def load_column(data : String) : UploadedFile #

Loads attachment from column data.

attacher.file #=> nil
attacher.load_column('{"id":"...","storage":"...","metadata":{...}}')
attacher.file #=> #<Shrine::UploadedFile>

[View source]
def load_column(data : Nil) : Nil #

[View source]