<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -54,7 +54,7 @@ module HasImage
         :thumbnails =&gt; {},
         :max_size =&gt; 12.megabytes,
         :min_size =&gt; 4.kilobytes,
-        :path_prefix =&gt; klass.to_s.tableize,
+        :path_prefix =&gt; klass.table_name,
         :base_path =&gt; File.join(RAILS_ROOT, 'public'),
         :column =&gt; :has_image_file,
         :convert_to =&gt; &quot;JPEG&quot;,</diff>
      <filename>lib/has_image.rb</filename>
    </modified>
    <modified>
      <diff>@@ -11,7 +11,9 @@ class StorageTest &lt; Test::Unit::TestCase
   end
   
   def default_options
-    HasImage.default_options_for(&quot;tests&quot;).merge(
+    mock_class = &quot;test&quot;
+    mock_class.stubs(:table_name).returns('tests')
+    HasImage.default_options_for(mock_class).merge(
       :base_path =&gt; File.join(File.dirname(__FILE__), '..', 'tmp')
     )
   end
@@ -115,7 +117,7 @@ class StorageTest &lt; Test::Unit::TestCase
     @name = @storage.install_images(stub(:has_image_id =&gt; 1))
     assert @storage.remove_images(stub(:has_image_id =&gt; 1), @name)
   end
-
+  
   def test_image_not_too_small
     @storage = HasImage::Storage.new(default_options.merge(:min_size =&gt; 1.kilobyte))
     @storage.image_data = temp_file(&quot;image.jpg&quot;)</diff>
      <filename>test/storage_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,10 +1,14 @@
 require 'test_helper'
 
+class Pic &lt; ActiveRecord::Base
+  has_image
+end
+
+class PicWithDifferentTableName &lt; ActiveRecord::Base
+  set_table_name 'pics'
+end
+
 class PicTest &lt; Test::Unit::TestCase
-  class Pic &lt; ActiveRecord::Base
-    has_image
-  end
-  
   def setup
     Pic.has_image_options = HasImage.default_options_for(Pic)
     Pic.has_image_options[:base_path] = File.join(RAILS_ROOT, '/tmp')
@@ -56,6 +60,10 @@ class PicTest &lt; Test::Unit::TestCase
     path = HasImage::Storage.partitioned_path @pic.id
     assert_equal @pic, Pic.from_partitioned_path(path)
   end
+  
+  def test_default_options_respect_table_name
+    assert_equal 'pics', HasImage.default_options_for(PicWithDifferentTableName)[:path_prefix]
+  end
 
   def test_regenerate_thumbnails_succeeds
     Pic.has_image_options = HasImage.default_options_for(Pic).merge(</diff>
      <filename>test_rails/pic_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>2aa128d9f79434d6f2f477b60b4ed9ca37ebff4e</id>
    </parent>
  </parents>
  <author>
    <name>Gerrit Kaiser</name>
    <email>gerrit@gerritkaiser.de</email>
  </author>
  <url>http://github.com/norman/has_image/commit/05a2527dd190e39d1ae60f7e48f40ad5c79002ab</url>
  <id>05a2527dd190e39d1ae60f7e48f40ad5c79002ab</id>
  <committed-date>2008-10-20T21:45:24-07:00</committed-date>
  <authored-date>2008-10-20T21:27:13-07:00</authored-date>
  <message>fixed bug where default options wouldn honour custom table name</message>
  <tree>737316c40ca26872d5fe73a8b7cb5322046d9fe3</tree>
  <committer>
    <name>Gerrit Kaiser</name>
    <email>gerrit@gerritkaiser.de</email>
  </committer>
</commit>
