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
29 def copy(attacher)
30   options = {action: :copy, move: false}
31 
32   copied_attachment = if attacher.cached?
33                         cache!(attacher.get, **options)
34                       elsif attacher.stored?
35                         store!(attacher.get, **options)
36                       else
37                         nil
38                       end
39 
40   @old = get
41   _set(copied_attachment)
42 end