Sha256: abb429e4d118870db8b3f0a82797098b710c4f62a88d3f165666952f78e3131e

Contents?: true

Size: 674 Bytes

Versions: 5

Compression:

Stored size: 674 Bytes

Contents

require 'paperclip'

module Paperclip

# force older versions of Paperclip::Upfile to be idempotent
# https://github.com/thoughtbot/paperclip/issues/315
  class SaveUpload < Processor
    # :call-seq:
    # initialize file, opts, attachment
    #
    # file       : File:/tmp/stream_stuff.xls
    # opts       : has_attached_file(:processors,:attachment_attr)
    # attachment : Paperclip::Attachment

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

    # :call-seq:
    # make
    #
    # called by paperclip after_save

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

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
importable_attachments-0.0.18 lib/paperclip_processors/save_upload.rb
importable_attachments-0.0.17 lib/paperclip_processors/save_upload.rb
importable_attachments-0.0.15 lib/paperclip_processors/save_upload.rb
importable_attachments-0.0.14 lib/paperclip_processors/save_upload.rb
importable_attachments-0.0.13 lib/paperclip_processors/save_upload.rb