Files

Paperclip::Storage::Filesystem

The default place to store attachments is in the filesystem. Files on the local filesystem can be very easily served by Apache without requiring a hit to your app. They also can be processed more easily after they've been saved, as they're just normal files. There is one Filesystem-specific option for has_attached_file.

Public Class Methods

extended(base) click to toggle source
# File lib/dm-paperclip/storage/filesystem.rb, line 19
def self.extended base
end

Public Instance Methods

exists?(style_name = default_style) click to toggle source
# File lib/dm-paperclip/storage/filesystem.rb, line 22
def exists?(style_name = default_style)
  if original_filename
    File.exist?(path(style_name))
  else
    false
  end
end
to_file(style_name = default_style) click to toggle source

Returns representation of the data of the file assigned to the given style, in the format most representative of the current storage.

# File lib/dm-paperclip/storage/filesystem.rb, line 32
def to_file style_name = default_style
  @queued_for_write[style_name] || (File.new(path(style_name), 'rb') if exists?(style_name))
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.