Class: Paperclip::SaveUpload

Inherits:
Processor
  • Object
show all
Defined in:
lib/paperclip_processors/save_upload.rb

Overview

force older versions of Paperclip::Upfile to be idempotent github.com/thoughtbot/paperclip/issues/315

Instance Method Summary collapse

Constructor Details

#initialize(file, options = {}, attachment = nil) ⇒ SaveUpload

:call-seq: initialize file, opts, attachment

file : File:/tmp/stream_stuff.xls opts : has_attached_file(:processors,:attachment_attr) attachment : Paperclip::Attachment



15
16
17
18
# File 'lib/paperclip_processors/save_upload.rb', line 15

def initialize(file, options = {}, attachment = nil)
  @attachment = attachment
  @file = file
end

Instance Method Details

#makeObject

:call-seq: make

called by paperclip after_save



25
26
27
28
29
# File 'lib/paperclip_processors/save_upload.rb', line 25

def make
  @file.read(1)
  @file.rewind
  @file
end