module Shrine::Plugins::Copy::AttacherMethods

  1. lib/shrine/plugins/copy.rb

Methods

Public Instance

  1. copy

Public Instance methods

copy (attacher)
[show source]
# File lib/shrine/plugins/copy.rb, line 34
def copy(attacher)
  options = {action: :copy, move: false}

  copied_attachment = if attacher.cached?
                        cache!(attacher.get, **options)
                      elsif attacher.stored?
                        store!(attacher.get, **options)
                      else
                        nil
                      end

  @old = get
  _set(copied_attachment)
end