module Shrine::Plugins::Model::AttacherClassMethods
Public Instance Methods
# File lib/shrine/plugins/model.rb 85 def from_model(record, name, **) 86 attacher = new(**) 87 attacher.load_model(record, name) 88 attacher 89 end
Initializes itself from a model instance and attachment name.
photo.image_data #=> "{...}" # a file is attached attacher = Attacher.from_model(photo, :image) attacher.file #=> #<Shrine::UploadedFile>