<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -61,6 +61,7 @@ module Paperclip
     # If the file that is assigned is not valid, the processing (i.e.
     # thumbnailing, etc) will NOT be run.
     def assign uploaded_file
+
       ensure_required_accessors!
 
       if uploaded_file.is_a?(Paperclip::Attachment)
@@ -75,11 +76,19 @@ module Paperclip
 
       return nil if uploaded_file.nil?
 
-      @queued_for_write[:original]   = uploaded_file.to_tempfile
-      instance_write(:file_name,       uploaded_file.original_filename.strip.gsub(/[^\w\d\.\-]+/, '_'))
-      instance_write(:content_type,    uploaded_file.content_type.to_s.strip)
-      instance_write(:file_size,       uploaded_file.size.to_i)
-      instance_write(:updated_at,      Time.now)
+      if uploaded_file.respond_to?(:[])
+        @queued_for_write[:original]   = uploaded_file['tempfile']
+        instance_write(:file_name,       uploaded_file['filename'].strip.gsub(/[^\w\d\.\-]+/, '_'))
+        instance_write(:content_type,    uploaded_file['content_type'].strip)
+        instance_write(:file_size,       uploaded_file['size'].to_i)
+        instance_write(:updated_at,      Time.now)
+      else
+        @queued_for_write[:original]   = uploaded_file.to_tempfile
+        instance_write(:file_name,       uploaded_file.original_filename.strip.gsub(/[^\w\d\.\-]+/, '_'))
+        instance_write(:content_type,    uploaded_file.content_type.to_s.strip)
+        instance_write(:file_size,       uploaded_file.size.to_i)
+        instance_write(:updated_at,      Time.now)
+      end
 
       @dirty = true
 
@@ -87,6 +96,7 @@ module Paperclip
 
       # Reset the file size if the original file was reprocessed.
       instance_write(:file_size, @queued_for_write[:original].size.to_i)
+
     ensure
       uploaded_file.close if close_uploaded_file
       validate
@@ -262,7 +272,11 @@ module Paperclip
     end
 
     def valid_assignment? file #:nodoc:
-      file.nil? || (file.respond_to?(:original_filename) &amp;&amp; file.respond_to?(:content_type))
+      if file.respond_to?(:[])
+        file[:filename] &amp;&amp; file[:content_type]
+      else
+        file.nil? || (file.respond_to?(:original_filename) &amp;&amp; file.respond_to?(:content_type))
+      end
     end
 
     def validate #:nodoc:</diff>
      <filename>lib/dm-paperclip/attachment.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>139d9a3ae25bc20064de844094a3d7fc1664e61d</id>
    </parent>
  </parents>
  <author>
    <name>snusnu</name>
    <email>gamsnjaga@gmail.com</email>
  </author>
  <url>http://github.com/krobertson/dm-paperclip/commit/15a6528a3a08490c983aada4272dc6791d2e749e</url>
  <id>15a6528a3a08490c983aada4272dc6791d2e749e</id>
  <committed-date>2009-06-14T22:32:26-07:00</committed-date>
  <authored-date>2009-06-07T19:33:59-07:00</authored-date>
  <message>support attachments that come from a form upload

* i don't know why this functionality was removed,
  or if it probably is replaced with something else
  or used differently now.

* i added back the behavior like it in older versions
  of dm-paperclip, see http://is.gd/Snwx

Signed-off-by: Ken Robertson &lt;ken@qgyen.net&gt;</message>
  <tree>1596841c52403f15681b6f2dc73df0435ec5bf56</tree>
  <committer>
    <name>Ken Robertson</name>
    <email>ken@qgyen.net</email>
  </committer>
</commit>
