Sha256: 9a3a94e268c7f5f9e9d4d324db02f31204cf86522729722b6a1d7b44e95be7c3

Contents?: true

Size: 621 Bytes

Versions: 34

Compression:

Stored size: 621 Bytes

Contents

module FileColumn

  # This bit of code allows you to pass regular old files to
  # file_column.  file_column depends on a few extra methods that the
  # CGI uploaded file class adds.  We will add the equivalent methods
  # to file objects if necessary by extending them with this module. This
  # avoids opening up the standard File class which might result in
  # naming conflicts.

  module FileCompat # :nodoc:
    def original_filename
      File.basename(path)
    end
    
    def size
      File.size(path)
    end
    
    def local_path
      path
    end
    
    def content_type
      nil
    end
  end
end

Version data entries

34 entries across 34 versions & 6 rubygems

Version Path
file_column_with_s3-0.3.0 lib/file_compat.rb
file_column_with_s3-0.2.0 lib/file_compat.rb
file_column_with_s3-0.1.9 lib/file_compat.rb
file_column_with_s3-0.1.8 lib/file_compat.rb
file_column_with_s3-0.1.7 lib/file_compat.rb
file_column_with_s3-0.1.6 lib/file_compat.rb
file_column_with_s3-0.1.5 lib/file_compat.rb
file_column_with_s3-0.1.4 lib/file_compat.rb
file_column_with_s3-0.1.3 lib/file_compat.rb
file_column_with_s3-0.1.2 lib/file_compat.rb
file_column_with_s3-0.1.1 lib/file_compat.rb
file_column_with_s3-0.1.0 lib/file_compat.rb
file_column-0.3.2 lib/file_compat.rb
admin_assistant-2.0.1 rails_2_test/vendor/plugins/file_column/lib/file_compat.rb
admin_assistant-1.0.1 test_rails_app/vendor/plugins/file_column/lib/file_compat.rb
file-column-0.3.2 lib/file_compat.rb
avatar-0.0.1 test/lib/file_column/lib/file_compat.rb
avatar-0.0.2 test/lib/file_column/lib/file_compat.rb
avatar-0.0.3 test/lib/file_column/lib/file_compat.rb
avatar-0.0.4 test/lib/file_column/lib/file_compat.rb