<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,3 @@
 require File.join(File.dirname(__FILE__), &quot;lib&quot;, &quot;paperclip&quot;)
-ActiveRecord::Base.extend( Thoughtbot::Paperclip::ClassMethods )
-File.send :include, Thoughtbot::Paperclip::Upfile
\ No newline at end of file
+ActiveRecord::Base.extend( Paperclip::ClassMethods )
+File.send :include, Paperclip::Upfile
\ No newline at end of file</diff>
      <filename>init.rb</filename>
    </modified>
    <modified>
      <diff>@@ -395,11 +395,12 @@ module Paperclip
       options = attachment_names.last.is_a?(Hash) ? attachment_names.pop : {}
 
       include InstanceMethods
-      class_inheritable_hash :attachment_definitions
+      #class_inheritable_hash :attachment_definitions
+      @attachment_definitions ||= {}
 
       attachment_names.each do |aname|
         whine_about_columns_for aname
-        self.attachment_definitions[aname] = AttachmentDefinition.new(aname, options)
+        @attachment_definitions[aname] = AttachmentDefinition.new(aname, options)
 
         define_method aname do
           attachment_for(aname)
@@ -412,7 +413,11 @@ module Paperclip
     end
 
     def attached_files
-      attachment_definitions.keys
+      @attachment_definitions.keys
+    end
+    
+    def attachment_definition_for attachment
+      @attachment_definitions[attachment]
     end
 
     # Adds errors if the attachments you specify are either missing or had errors on them.
@@ -426,10 +431,9 @@ module Paperclip
     end
 
     def whine_about_columns_for attachment #:nodoc:
-      name = attachment[:name]
-      unless column_names.include?(&quot;#{name}_file_name&quot;) &amp;&amp; column_names.include?(&quot;#{name}_content_type&quot;)
-        error = &quot;Class #{self.name} does not have the necessary columns to have an attachment named #{name}. &quot; +
-                &quot;(#{name}_file_name and #{name}_content_type)&quot;
+      unless column_names.include?(&quot;#{attachment}_file_name&quot;) &amp;&amp; column_names.include?(&quot;#{attachment}_content_type&quot;)
+        error = &quot;Class #{name} does not have the necessary columns to have an attachment named #{attachment}. &quot; +
+                &quot;(#{attachment}_file_name and #{attachment}_content_type)&quot;
         raise PaperclipError, error
       end
     end</diff>
      <filename>lib/paperclip.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 require 'test/unit'
 require File.dirname(__FILE__) + &quot;/test_helper.rb&quot;
 require File.dirname(__FILE__) + &quot;/simply_shoulda.rb&quot;
-require File.dirname(__FILE__) + &quot;/../lib/paperclip-c.rb&quot;
+require File.dirname(__FILE__) + &quot;/../init.rb&quot;
 
 class PaperclipTest &lt; Test::Unit::TestCase
 
@@ -29,6 +29,7 @@ class PaperclipTest &lt; Test::Unit::TestCase
           table.column :document_content_type, :string
           table.column :document_file_size, :integer
         end
+        Object.send(:remove_const, :Foo) rescue nil
         class ::Foo &lt; ActiveRecord::Base; end
       end
 
@@ -51,6 +52,7 @@ class PaperclipTest &lt; Test::Unit::TestCase
       should &quot;be able to set options on attachments&quot; do
         assert Foo.has_attached_file :image, :thumbnails =&gt; {:thumb =&gt; &quot;100x100&quot;}
         assert_equal [:image], Foo.attached_files
+        assert_equal( {:thumb =&gt; &quot;100x100&quot;}, Foo.attachment_definition_for(:image).thumbnails )
       end
     end
 </diff>
      <filename>test/paperclip_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>d68a942156de69d170dab67eeb218b685612d75c</id>
    </parent>
  </parents>
  <author>
    <name>jyurek</name>
    <email>jyurek@7bbfaf0e-4d1d-0410-9690-a8bb5f8ef2aa</email>
  </author>
  <url>http://github.com/thoughtbot/paperclip/commit/26444ced7ca5a64b2697016dc409ba177ad1ff72</url>
  <id>26444ced7ca5a64b2697016dc409ba177ad1ff72</id>
  <committed-date>2007-11-09T08:17:58-08:00</committed-date>
  <authored-date>2007-11-09T08:17:58-08:00</authored-date>
  <message>On the way to good-code-dom

git-svn-id: https://svn.thoughtbot.com/plugins/paperclip/trunk@241 7bbfaf0e-4d1d-0410-9690-a8bb5f8ef2aa</message>
  <tree>69ef688bc5d651d9d04c6d30a259ac48256ff4e3</tree>
  <committer>
    <name>jyurek</name>
    <email>jyurek@7bbfaf0e-4d1d-0410-9690-a8bb5f8ef2aa</email>
  </committer>
</commit>
