module Shrine::Plugins::Copy::AttachmentMethods

  1. lib/shrine/plugins/copy.rb

Methods

Public Class

  1. new

Public Class methods

new (*)
[show source]
# File lib/shrine/plugins/copy.rb, line 19
        def initialize(*)
          super

          module_eval "            def initialize_copy(record)
              super
              @#{@name}_attacher = nil # reload the attacher
              #{@name}_attacher.send(:write, nil) # remove original attachment
              #{@name}_attacher.copy(record.#{@name}_attacher)
            end
", __FILE__, __LINE__ + 1
        end