Sha256: 6a306e52795b0a9e29d92207347e34e6c36e8882d46d325e01d2bed02dde263c

Contents?: true

Size: 463 Bytes

Versions: 42

Compression:

Stored size: 463 Bytes

Contents

module Paperclip
  class NilAdapter < AbstractAdapter
    def initialize(target)
    end

    def original_filename
      ""
    end

    def content_type
      ""
    end

    def size
      0
    end

    def nil?
      true
    end

    def read(*args)
      nil
    end

    def eof?
      true
    end
  end
end

Paperclip.io_adapters.register Paperclip::NilAdapter do |target|
  target.nil? || ( (Paperclip::Attachment === target) && !target.present? )
end

Version data entries

42 entries across 40 versions & 6 rubygems

Version Path
kt-paperclip-4.4.0 lib/paperclip/io_adapters/nil_adapter.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/paperclip-5.1.0/lib/paperclip/io_adapters/nil_adapter.rb
paperclip-5.1.0 lib/paperclip/io_adapters/nil_adapter.rb
paperclip-5.0.0 lib/paperclip/io_adapters/nil_adapter.rb
paperclip-4.3.7 lib/paperclip/io_adapters/nil_adapter.rb
paperclip_jk-5.0.0.beta2 lib/paperclip/io_adapters/nil_adapter.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/paperclip-4.3.6/lib/paperclip/io_adapters/nil_adapter.rb
paperclip-5.0.0.beta2 lib/paperclip/io_adapters/nil_adapter.rb
paperclip-5.0.0.beta1 lib/paperclip/io_adapters/nil_adapter.rb
paperclip-4.3.6 lib/paperclip/io_adapters/nil_adapter.rb
paperclip-4.3.5 lib/paperclip/io_adapters/nil_adapter.rb
paperclip-4.3.4 lib/paperclip/io_adapters/nil_adapter.rb
paperclip-4.3.3 lib/paperclip/io_adapters/nil_adapter.rb
paperclip-4.3.2 lib/paperclip/io_adapters/nil_adapter.rb
paperclip-4.3.1 lib/paperclip/io_adapters/nil_adapter.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/paperclip-4.2.4/lib/paperclip/io_adapters/nil_adapter.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/paperclip-4.2.4/lib/paperclip/io_adapters/nil_adapter.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/paperclip-4.2.3/lib/paperclip/io_adapters/nil_adapter.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/paperclip-4.2.2/lib/paperclip/io_adapters/nil_adapter.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/paperclip-4.2.4/lib/paperclip/io_adapters/nil_adapter.rb