Class: Paperclip::SaveUpload
- Inherits:
-
Processor
- Object
- Processor
- Paperclip::SaveUpload
- 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
-
#initialize(file, options = {}, attachment = nil) ⇒ SaveUpload
constructor
:call-seq: initialize file, opts, attachment.
-
#make ⇒ Object
:call-seq: make.
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, = {}, = nil) @attachment = @file = file end |
Instance Method Details
#make ⇒ Object
: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 |