<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>test/backends/remote/s3_test.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,14 +1,14 @@
 development:
-  secret_access_key: AbCDEfGHiJKlmNOPQRS1
-  access_key_id: 1234567891abcdeFGHI/JKL+MnoPQrsT123UvwX4
-  bucket_prefix: appname_development
+  bucket_name: appname_development
+  access_key_id: 
+  secret_access_key: 
 
 test:
-  secret_access_key: AbCDEfGHiJKlmNOPQRS1
-  access_key_id: 1234567891abcdeFGHI/JKL+MnoPQrsT123UvwX4
-  bucket_prefix: appname_test
+  bucket_name: appname_test
+  access_key_id: 
+  secret_access_key: 
 
 production:
-  secret_access_key: AbCDEfGHiJKlmNOPQRS1
-  access_key_id: 1234567891abcdeFGHI/JKL+MnoPQrsT123UvwX4
-  bucket_prefix: appname
\ No newline at end of file
+  bucket_name: appname
+  access_key_id: 
+  secret_access_key: </diff>
      <filename>amazon_s3.yml.tpl</filename>
    </modified>
    <modified>
      <diff>@@ -18,8 +18,8 @@ module Technoweenie # :nodoc:
       # *  &lt;tt&gt;:resize_to&lt;/tt&gt; - Used by RMagick to resize images.  Pass either an array of width/height, or a geometry string.
       # *  &lt;tt&gt;:thumbnails&lt;/tt&gt; - Specifies a set of thumbnails to generate.  This accepts a hash of filename suffixes and RMagick resizing options.
       # *  &lt;tt&gt;:thumbnail_class&lt;/tt&gt; - Set what class to use for thumbnails.  This attachment class is used by default.
-      # *  &lt;tt&gt;:file_system_path&lt;/tt&gt; - path to store the uploaded files.  Uses public/#{table_name} by default.  
-      #                                 Setting this sets the :storage to :file_system.
+      # *  &lt;tt&gt;:path_prefix&lt;/tt&gt; - path to store the uploaded files.  Uses public/#{table_name} by default for the filesystem, and just #{table_name}
+      #      for the S3 backend.  Setting this sets the :storage to :file_system.
       # *  &lt;tt&gt;:storage&lt;/tt&gt; - Use :file_system to specify the attachment data is stored with the file system.  Defaults to :db_system.
       #
       # Examples:
@@ -30,10 +30,10 @@ module Technoweenie # :nodoc:
       #   has_attachment :content_type =&gt; :image, :resize_to =&gt; [50,50]
       #   has_attachment :content_type =&gt; ['application/pdf', :image], :resize_to =&gt; 'x50'
       #   has_attachment :thumbnails =&gt; { :thumb =&gt; [50, 50], :geometry =&gt; 'x50' }
-      #   has_attachment :storage =&gt; :file_system, :file_system_path =&gt; 'public/files'
-      #   has_attachment :storage =&gt; :file_system, :file_system_path =&gt; 'public/files', 
+      #   has_attachment :storage =&gt; :file_system, :path_prefix =&gt; 'public/files'
+      #   has_attachment :storage =&gt; :file_system, :path_prefix =&gt; 'public/files', 
       #     :content_type =&gt; :image, :resize_to =&gt; [50,50]
-      #   has_attachment :storage =&gt; :file_system, :file_system_path =&gt; 'public/files',
+      #   has_attachment :storage =&gt; :file_system, :path_prefix =&gt; 'public/files',
       #     :thumbnails =&gt; { :thumb =&gt; [50, 50], :geometry =&gt; 'x50' }
       #   has_attachment :storage =&gt; :s3
       def has_attachment(options = {})
@@ -50,9 +50,12 @@ module Technoweenie # :nodoc:
           class_inheritable_accessor :attachment_options
           attr_accessor :thumbnail_resize_options
 
-          options[:storage]          ||= options[:file_system_path] ? :file_system : :db_file
-          options[:file_system_path] ||= File.join(&quot;public&quot;, table_name)
-          options[:file_system_path]   = options[:file_system_path][1..-1] if options[:file_system_path].first == '/'
+          options[:storage]     ||= (options[:file_system_path] || options[:path_prefix]) ? :file_system : :db_file
+          options[:path_prefix] ||= options[:file_system_path]
+          if options[:path_prefix].nil?
+            options[:path_prefix] = options[:storage] == :s3 ? table_name : File.join(&quot;public&quot;, table_name)
+          end
+          options[:path_prefix]   = options[:path_prefix][1..-1] if options[:path_prefix].first == '/'
 
           with_options :foreign_key =&gt; 'parent_id' do |m|
             m.has_many   :thumbnails, :dependent =&gt; :destroy, :class_name =&gt; options[:thumbnail_class].to_s</diff>
      <filename>lib/technoweenie/attachment_fu.rb</filename>
    </modified>
    <modified>
      <diff>@@ -16,7 +16,7 @@ module Technoweenie # :nodoc:
         # Overwrite this method in your model to customize the filename.
         # The optional thumbnail argument will output the thumbnail's filename.
         def full_filename(thumbnail = nil)
-          file_system_path = (thumbnail ? thumbnail_class : self).attachment_options[:file_system_path].to_s
+          file_system_path = (thumbnail ? thumbnail_class : self).attachment_options[:path_prefix].to_s
           File.join(RAILS_ROOT, file_system_path, attachment_path_id, thumbnail_name_for(thumbnail))
         end
       </diff>
      <filename>lib/technoweenie/attachment_fu/backends/file_system.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,50 +3,58 @@ module Technoweenie # :nodoc:
     module Backends
       # = AWS::S3 Storage Backend
       #
-      # Enables use of Amazon's Simple Storage Service (http://aws.amazon.com/s3) as a storage mechanism
+      # Enables use of {Amazon's Simple Storage Service}[http://aws.amazon.com/s3] as a storage mechanism
       #
       # == Requirements
       #
-      # Requires the AWS::S3 Library for S3 by Marcel Molina Jr. (http://amazon.rubyforge.org) installed either
+      # Requires the {AWS::S3 Library}[http://amazon.rubyforge.org] for S3 by Marcel Molina Jr. installed either
       # as a gem or a as a Rails plugin.
       #
       # == Configuration
       #
       # Configuration is done via &lt;tt&gt;RAILS_ROOT/config/amazon_s3.yml&lt;/tt&gt; and is loaded according to the &lt;tt&gt;RAILS_ENV&lt;/tt&gt;.
-      # The minimum connection options that you must specify are your access key id and your secret access key.
+      # The minimum connection options that you must specify are a bucket name, your access key id and your secret access key.
       # If you don't already have your access keys, all you need to sign up for the S3 service is an account at Amazon.
       # You can sign up for S3 and get access keys by visiting http://aws.amazon.com/s3.
-      # 
+      #
       # Example configuration (RAILS_ROOT/config/amazon_s3.yml)
       # 
       #   development:
-      #     secret_access_key: AbCDEfGHiJKlmNOPQRS1
-      #     access_key_id: 1234567891abcdeFGHI/JKL+MnoPQrsT123UvwX4
-      #     bucket_prefix: appname_development
+      #     bucket_name: appname_development
+      #     access_key_id: &lt;your key&gt;
+      #     secret_access_key: &lt;your key&gt;
       #   
       #   test:
-      #     secret_access_key: AbCDEfGHiJKlmNOPQRS1
-      #     access_key_id: 1234567891abcdeFGHI/JKL+MnoPQrsT123UvwX4
-      #     bucket_prefix: appname_test
+      #     bucket_name: appname_test
+      #     access_key_id: &lt;your key&gt;
+      #     secret_access_key: &lt;your key&gt;
       #   
       #   production:
-      #     secret_access_key: AbCDEfGHiJKlmNOPQRS1
-      #     access_key_id: 1234567891abcdeFGHI/JKL+MnoPQrsT123UvwX4
-      #     bucket_prefix: appname
+      #     bucket_name: appname
+      #     access_key_id: &lt;your key&gt;
+      #     secret_access_key: &lt;your key&gt;
       #
-      # === Required arguments
+      # === Required configuration parameters
       #
       # * &lt;tt&gt;:access_key_id&lt;/tt&gt; - The access key id for your S3 account. Provided by Amazon.
       # * &lt;tt&gt;:secret_access_key&lt;/tt&gt; - The secret access key for your S3 account. Provided by Amazon.
-      # * &lt;tt&gt;:bucket_prefix&lt;/tt&gt; - The string prefix to assign to each bucket. Used to create unique bucket names in the format &lt;tt&gt;#{bucket_prefix}_#{table_name}&lt;/tt&gt;.
+      # * &lt;tt&gt;:bucket_name&lt;/tt&gt; - A unique bucket name (think of the bucket_name as being like a database name).
       #
       # If any of these required arguments is missing, a MissingAccessKey exception will be raised from AWS::S3.
       #
-      # === Optional arguments
+      # == About bucket names
+      #
+      # Bucket names have to be globaly unique across the S3 system. And you can only have up to 100 of them,
+      # so it's a good idea to think of a bucket as being like a database, hence the correspondance in this
+      # implementation to the development, test, and production environments.
+      #
+      # The number of objects you can store in a bucket is, for all intents and purposes, unlimited.
       #
-      # * &lt;tt&gt;:server&lt;/tt&gt; - The server to make requests to. You can use this to specify your bucket in the subdomain, or your own domain's cname if you are using virtual hosted buckets. Defaults to &lt;tt&gt;s3.amazonaws.com&lt;/tt&gt;.
+      # === Optional configuration parameters
+      #
+      # * &lt;tt&gt;:server&lt;/tt&gt; - The server to make requests to. Defaults to &lt;tt&gt;s3.amazonaws.com&lt;/tt&gt;.
       # * &lt;tt&gt;:port&lt;/tt&gt; - The port to the requests should be made on. Defaults to 80 or 443 if &lt;tt&gt;:use_ssl&lt;/tt&gt; is set.
-      # * &lt;tt&gt;:use_ssl&lt;/tt&gt; - Whether requests should be made over SSL. If set to true, &lt;tt&gt;:port&lt;/tt&gt; will be implicitly set to 443, unless specified otherwise. Defaults to false.
+      # * &lt;tt&gt;:use_ssl&lt;/tt&gt; - If set to true, &lt;tt&gt;:port&lt;/tt&gt; will be implicitly set to 443, unless specified otherwise. Defaults to false.
       #
       # == Usage
       #
@@ -56,79 +64,200 @@ module Technoweenie # :nodoc:
       #     has_attachment :storage =&gt; :s3
       #   end
       #
-      # Of course, all the usual configuration options apply:
+      # === Customizing the path
+      #
+      # By default, files are prefixed using a pseudo hierarchy in the form of &lt;tt&gt;:table_name/:id&lt;/tt&gt;, which results
+      # in S3 urls that look like: http(s)://:server/:bucket_name/:table_name/:id/:filename with :table_name
+      # representing the customizable portion of the path. You can customize this prefix using the &lt;tt&gt;:path_prefix&lt;/tt&gt;
+      # option:
+      #
+      #   class Photo &lt; ActiveRecord::Base
+      #     has_attachment :storage =&gt; :s3, :path_prefix =&gt; 'my/custom/path'
+      #   end
+      #
+      # Which would result in URLs like &lt;tt&gt;http(s)://:server/:bucket_name/my/custom/path/:id/:filename.&lt;/tt&gt;
+      #
+      # === Permissions
+      #
+      # By default, files are stored on S3 with public access permissions. You can customize this using
+      # the &lt;tt&gt;:s3_access&lt;/tt&gt; option to &lt;tt&gt;has_attachment&lt;/tt&gt;. Available values are 
+      # &lt;tt&gt;:private&lt;/tt&gt;, &lt;tt&gt;:public_read_write&lt;/tt&gt;, and &lt;tt&gt;:authenticated_read&lt;/tt&gt;.
+      #
+      # === Other options
+      #
+      # Of course, all the usual configuration options apply, such as content_type and thumbnails:
       #
-      #   has_attachment :storage =&gt; :s3, :content_type =&gt; ['application/pdf', :image], :resize_to =&gt; 'x50'
-      #   has_attachment :storage =&gt; :s3, :thumbnails =&gt; { :thumb =&gt; [50, 50], :geometry =&gt; 'x50' }
+      #   class Photo &lt; ActiveRecord::Base
+      #     has_attachment :storage =&gt; :s3, :content_type =&gt; ['application/pdf', :image], :resize_to =&gt; 'x50'
+      #     has_attachment :storage =&gt; :s3, :thumbnails =&gt; { :thumb =&gt; [50, 50], :geometry =&gt; 'x50' }
+      #   end
+      #
+      # === Accessing S3 URLs
+      #
+      # You can get an object's URL using the s3_url accessor. For example, assuming that for your postcard app
+      # you had a bucket name like 'postcard_world_development', and an attachment model called Photo:
+      #
+      #   @postcard.s3_url # =&gt; http(s)://s3.amazonaws.com/postcard_world_development/photos/1/mexico.jpg
+      #
+      # The resulting url is in the form: http(s)://:server/:bucket_name/:table_name/:id/:file.
+      # The optional thumbnail argument will output the thumbnail's filename (if any).
+      #
+      # Additionally, you can get an object's base path relative to the bucket root using
+      # &lt;tt&gt;base_path&lt;/tt&gt;:
+      #
+      #   @photo.file_base_path # =&gt; photos/1
+      #
+      # And the full path (including the filename) using &lt;tt&gt;full_filename&lt;/tt&gt;:
+      #
+      #   @photo.full_filename # =&gt; photos/
+      #
+      # Niether &lt;tt&gt;base_path&lt;/tt&gt; or &lt;tt&gt;full_filename&lt;/tt&gt; include the bucket name as part of the path.
+      # You can retrieve the bucket name using the &lt;tt&gt;bucket_name&lt;/tt&gt; method.
       module S3
-        class S3RequiredLibraryNotFound &lt; StandardError; end
-        class S3ConfigFileNotFound &lt; StandardError; end
-        class S3BucketExists &lt; StandardError; end
+        class S3RequiredLibraryNotFoundError &lt; StandardError; end
+        class S3ConfigFileNotFoundError &lt; StandardError; end
 
         def self.included(base) #:nodoc:
+          mattr_reader :bucket_name, :s3_config
+          
           begin
             require 'aws/s3'
+            include AWS::S3
           rescue LoadError
-            raise S3RequiredLibraryNotFound.new('AWS::S3 could not be loaded. Try installing with sudo gem i aws-s3, or see http://amazon.rubyforge.org for more information')
+            raise S3RequiredLibraryNotFoundError.new('AWS::S3 could not be loaded')
           end
 
           begin
             @@s3_config = YAML.load_file(RAILS_ROOT + '/config/amazon_s3.yml')[ENV['RAILS_ENV']].symbolize_keys
           rescue
-            raise S3ConfigFileNotFound.new('File RAILS_ROOT/config/amazon_s3.yml not found')
+            raise S3ConfigFileNotFoundError.new('File RAILS_ROOT/config/amazon_s3.yml not found')
           end
 
-          @@bucket = [@@s3_config.delete(:bucket_prefix), base.table_name].join('_')
-          mattr_reader :s3_config, :bucket
+          @@bucket_name = s3_config[:bucket_name]
+
+          Base.establish_connection!(
+            :access_key_id     =&gt; s3_config[:access_key_id],
+            :secret_access_key =&gt; s3_config[:secret_access_key],
+            :server            =&gt; s3_config[:server],
+            :port              =&gt; s3_config[:port],
+            :use_ssl           =&gt; s3_config[:use_ssl]
+          )
 
-          AWS::S3::Base.establish_connection!(s3_config)
-          find_or_create_bucket(bucket)
+          # Bucket.create(@@bucket_name)
 
           base.before_update :rename_file
         end
-      
-        def self.find_or_create_bucket(name)
-          AWS::S3::Bucket.find(name)
-        rescue AWS::S3::NoSuchBucket
-          AWS::S3::Bucket.create(name)
-        rescue AWS::S3::AccessDenied
-          raise S3BucketExists.new(&quot;Bucket name already exists: #{name}. Use a different bucket_prefix in RAILS_ROOT/config/amazon_s3.yml&quot;)
+
+        # Overwrites the base filename writer in order to store the old filename
+        def filename=(value)
+          @old_filename = filename unless filename.nil? || @old_filename
+          write_attribute :filename, sanitize_filename(value)
+        end
+
+        # The attachment ID used in the full path of a file
+        def attachment_path_id
+          ((respond_to?(:parent_id) &amp;&amp; parent_id) || id).to_s
+        end
+
+        # The pseudo hierarchy containing the file relative to the bucket name
+        # Example: &lt;tt&gt;:table_name/:id&lt;/tt&gt;
+        def base_path
+          File.join(attachment_options[:path_prefix], attachment_path_id)
+        end
+
+        # The full path to the file relative to the bucket name
+        # Example: &lt;tt&gt;:table_name/:id/:filename&lt;/tt&gt;
+        def full_filename(thumbnail = nil)
+          File.join(base_path, thumbnail_name_for(thumbnail))
         end
 
-        # Generates an S3 URL for the file in the form of: http(s)://&lt;tt&gt;{server}&lt;/tt&gt;/&lt;tt&gt;{bucket_name}&lt;/tt&gt;/&lt;tt&gt;{file_name}&lt;/tt&gt;
-        # The &lt;tt&gt;{server}&lt;/tt&gt; variable defaults to &lt;tt&gt;AWS::S3 URL::DEFAULT_HOST&lt;/tt&gt; (http://s3.amazonaws.com) and can be
-        # set using the configuration parameters in &lt;tt&gt;RAILS_ROOT/config/amazon_s3.yml&lt;/tt&gt;
+        # All public objects are accessible via a GET request to the S3 servers. You can generate a 
+        # url for an object using the s3_url method.
         #
-        # Example usage: &lt;tt&gt;image_tag(@photo.s3_url)&lt;/tt&gt;
+        #   @photo.s3_url
+        #
+        # The resulting url is in the form: &lt;tt&gt;http(s)://:server/:bucket_name/:table_name/:id/:file&lt;/tt&gt; where
+        # the &lt;tt&gt;:server&lt;/tt&gt; variable defaults to &lt;tt&gt;AWS::S3 URL::DEFAULT_HOST&lt;/tt&gt; (s3.amazonaws.com) and can be
+        # set using the configuration parameters in &lt;tt&gt;RAILS_ROOT/config/amazon_s3.yml&lt;/tt&gt;.
+        #
+        # The optional thumbnail argument will output the thumbnail's filename (if any).
         def s3_url(thumbnail = nil)
-          s3_config[:use_ssl] ? 'https://' : 'http://' + (s3_config[:server] || AWS::S3::DEFAULT_HOST) + '/' + bucket + '/' + thumbnail_name_for(thumbnail)
+          protocol, hostname = s3_config[:use_ssl] ? 'https://' : 'http://', s3_config[:server] || DEFAULT_HOST
+          protocol + File.join(hostname, bucket_name, full_filename(thumbnail))
         end
         alias :public_filename :s3_url
 
+        # All private objects are accessible via an authenticated GET request to the S3 servers. You can generate an 
+        # authenticated url for an object like this:
+        #
+        #   @photo.authenticated_s3_url
+        #
+        # By default authenticated urls expire 5 minutes after they were generated.
+        #
+        # Expiration options can be specified either with an absolute time using the &lt;tt&gt;:expires&lt;/tt&gt; option,
+        # or with a number of seconds relative to now with the &lt;tt&gt;:expires_in&lt;/tt&gt; option:
+        #
+        #   # Absolute expiration date (October 13th, 2025)
+        #   @photo.authenticated_s3_url(:expires =&gt; Time.mktime(2025,10,13).to_i)
+        #   
+        #   # Expiration in five hours from now
+        #   @photo.authenticated_s3_url(:expires_in =&gt; 5.hours)
+        #
+        # You can specify whether the url should go over SSL with the &lt;tt&gt;:use_ssl&lt;/tt&gt; option.
+        # By default, the ssl settings for the current connection will be used:
+        #
+        #   @photo.authenticated_s3_url(:use_ssl =&gt; true)
+        #
+        # Finally, the optional thumbnail argument will output the thumbnail's filename (if any):
+        #
+        #   @photo.authenticated_s3_url('thumbnail', :expires_in =&gt; 5.hours, :use_ssl =&gt; true)
+        def authenticated_s3_url(*args)
+          thumbnail = args.first.is_a?(String) ? args.first : nil
+          options   = args.last.is_a?(Hash)    ? args.last  : {}
+          S3Object.url_for(full_filename(thumbnail), bucket_name, options)
+        end
+
         def create_temp_file
           write_to_temp_file current_data
         end
 
         def current_data
-          AWS::S3::S3Object.value filename, bucket
+          S3Object.value full_filename, bucket_name
         end
 
         protected
-          # Destroys the file.  Called in the after_destroy callback
+          # Called in the after_destroy callback
           def destroy_file
-            AWS::S3::S3Object.delete filename, bucket
+            S3Object.delete full_filename, bucket_name
           end
-          
+
           def rename_file
             return unless @old_filename &amp;&amp; @old_filename != filename
-            AWS::S3::S3Object.rename(@old_filename, filename, bucket, :access =&gt; attachment_options[:s3_access])
+            
+            old_full_filename = File.join(base_path, @old_filename)
+
+            S3Object.rename(
+              old_full_filename,
+              full_filename,
+              bucket_name,
+              :access =&gt; attachment_options[:s3_access]
+            )
+
             @old_filename = nil
             true
           end
-          
-          # Saves the file to S3
+
           def save_to_storage
-            AWS::S3::S3Object.store(filename, temp_data, bucket, :content_type =&gt; content_type, :access =&gt; attachment_options[:s3_access]) if save_attachment?
+            if save_attachment?
+              S3Object.store(
+                full_filename,
+                temp_data,
+                bucket_name,
+                :content_type =&gt; content_type,
+                :access =&gt; attachment_options[:s3_access]
+              )
+            end
+
             @old_filename = nil
             true
           end</diff>
      <filename>lib/technoweenie/attachment_fu/backends/s3.rb</filename>
    </modified>
    <modified>
      <diff>@@ -40,17 +40,17 @@ class ImageWithThumbsAttachment &lt; Attachment
 end
 
 class FileAttachment &lt; ActiveRecord::Base
-  has_attachment :file_system_path =&gt; 'vendor/plugins/attachment_fu/test/files', :processor =&gt; :rmagick
+  has_attachment :path_prefix =&gt; 'vendor/plugins/attachment_fu/test/files', :processor =&gt; :rmagick
   validates_as_attachment
 end
 
 class ImageFileAttachment &lt; FileAttachment
-  has_attachment :file_system_path =&gt; 'vendor/plugins/attachment_fu/test/files',
+  has_attachment :path_prefix =&gt; 'vendor/plugins/attachment_fu/test/files',
     :content_type =&gt; :image, :resize_to =&gt; [50,50]
 end
 
 class ImageWithThumbsFileAttachment &lt; FileAttachment
-  has_attachment :file_system_path =&gt; 'vendor/plugins/attachment_fu/test/files',
+  has_attachment :path_prefix =&gt; 'vendor/plugins/attachment_fu/test/files',
     :thumbnails =&gt; { :thumb =&gt; [50, 50], :geometry =&gt; 'x50' }, :resize_to =&gt; [55,55]
   after_resize do |record, img|
     record.aspect_ratio = img.columns.to_f / img.rows.to_f
@@ -58,13 +58,14 @@ class ImageWithThumbsFileAttachment &lt; FileAttachment
 end
 
 class ImageWithThumbsClassFileAttachment &lt; FileAttachment
+  # use file_system_path to test backwards compatibility
   has_attachment :file_system_path =&gt; 'vendor/plugins/attachment_fu/test/files',
     :thumbnails =&gt; { :thumb =&gt; [50, 50] }, :resize_to =&gt; [55,55],
     :thumbnail_class =&gt; 'ImageThumbnail'
 end
 
 class ImageThumbnail &lt; FileAttachment
-  has_attachment :file_system_path =&gt; 'vendor/plugins/attachment_fu/test/files/thumbnails'
+  has_attachment :path_prefix =&gt; 'vendor/plugins/attachment_fu/test/files/thumbnails'
 end
 
 # no parent
@@ -75,7 +76,7 @@ end
 
 # no filename, no size, no content_type
 class MinimalAttachment &lt; ActiveRecord::Base
-  has_attachment :file_system_path =&gt; 'vendor/plugins/attachment_fu/test/files', :processor =&gt; :rmagick
+  has_attachment :path_prefix =&gt; 'vendor/plugins/attachment_fu/test/files', :processor =&gt; :rmagick
   validates_as_attachment
   
   def filename
@@ -85,8 +86,21 @@ end
 
 begin
   class ImageScienceAttachment &lt; ActiveRecord::Base
-    has_attachment :file_system_path =&gt; 'vendor/plugins/attachment_fu/test/files',
+    has_attachment :path_prefix =&gt; 'vendor/plugins/attachment_fu/test/files',
       :processor =&gt; :image_science, :thumbnails =&gt; { :thumb =&gt; [50, 51], :geometry =&gt; '31&gt;' }, :resize_to =&gt; 55
   end
 rescue MissingSourceFile
-end
\ No newline at end of file
+end
+
+begin
+  class S3Attachment &lt; ActiveRecord::Base
+    has_attachment :storage =&gt; :s3, :processor =&gt; :rmagick
+    validates_as_attachment
+  end
+
+  class S3WithPathPrefixAttachment &lt; S3Attachment
+    has_attachment :storage =&gt; :s3, :path_prefix =&gt; 'some/custom/path/prefix', :processor =&gt; :rmagick
+    validates_as_attachment
+  end
+rescue Technoweenie::AttachmentFu::Backends::S3::S3ConfigFileNotFoundError
+end</diff>
      <filename>test/fixtures/attachment.rb</filename>
    </modified>
    <modified>
      <diff>@@ -49,4 +49,16 @@ ActiveRecord::Schema.define(:version =&gt; 0) do
   create_table :db_files, :force =&gt; true do |t|
     t.column :data, :binary
   end
+
+  create_table :s3_attachments, :force =&gt; true do |t|
+    t.column :parent_id,       :integer
+    t.column :thumbnail,       :string 
+    t.column :filename,        :string, :limit =&gt; 255
+    t.column :content_type,    :string, :limit =&gt; 255
+    t.column :size,            :integer
+    t.column :width,           :integer
+    t.column :height,          :integer
+    t.column :type,            :string
+    t.column :aspect_ratio,    :float
+  end
 end
\ No newline at end of file</diff>
      <filename>test/schema.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,7 @@
 $:.unshift(File.dirname(__FILE__) + '/../lib')
 
+ENV['RAILS_ENV'] = 'test'
+
 require 'test/unit'
 require File.expand_path(File.join(File.dirname(__FILE__), '../../../../config/environment.rb'))
 require 'breakpoint'</diff>
      <filename>test/test_helper.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>4b76298835008a22702e544b7db19df343601e66</id>
    </parent>
  </parents>
  <author>
    <name>technoweenie</name>
    <email>technoweenie@567b1171-46fb-0310-a4c9-b4bef9110e78</email>
  </author>
  <url>http://github.com/crafterm/attachment_fu/commit/7be8acf8c42445b5e2d7306989d6731fe8ce4b42</url>
  <id>7be8acf8c42445b5e2d7306989d6731fe8ce4b42</id>
  <committed-date>2007-01-14T10:35:00-08:00</committed-date>
  <authored-date>2007-01-14T10:35:00-08:00</authored-date>
  <message>updates to s3 support with remote tests

git-svn-id: http://svn.techno-weenie.net/projects/plugins/attachment_fu@2675 567b1171-46fb-0310-a4c9-b4bef9110e78</message>
  <tree>8e88ae9a305c3316e8d6a7ad011d796fe054d9ef</tree>
  <committer>
    <name>technoweenie</name>
    <email>technoweenie@567b1171-46fb-0310-a4c9-b4bef9110e78</email>
  </committer>
</commit>
