public
Fork of technoweenie/attachment_fu
Description: Treat an ActiveRecord model as a file attachment, storing its patch, size, content type, etc.
Homepage: http://weblog.techno-weenie.net
Clone URL: git://github.com/nicksieger/attachment_fu.git
more fool-proof #thumbnailable? implementation [Ant Ramm]

git-svn-id: 
http://svn.techno-weenie.net/projects/plugins/attachment_fu@3007 
567b1171-46fb-0310-a4c9-b4bef9110e78
technoweenie (author)
Sun Oct 28 15:12:32 -0700 2007
commit  f2e6b17f36f7f1888a1200e321041e9c608b729e
tree    c90fb571e96d773a6d3daab476184d431a981e3d
parent  30a08b23cdf8e079ad54f2ad3a731976ba8572b0
...
183
184
185
186
 
187
188
189
...
183
184
185
 
186
187
188
189
0
@@ -183,7 +183,7 @@ module Technoweenie # :nodoc:
0
       
0
       # Returns true/false if an attachment is thumbnailable. A thumbnailable attachment has an image content type and the parent_id attribute.
0
       def thumbnailable?
0
- image? && respond_to?(:parent_id)
0
+ image? && respond_to?(:parent_id) && parent_id.nil?
0
       end
0
 
0
       # Returns the class used to create new thumbnails for this attachment.
...
162
163
164
 
165
166
167
...
162
163
164
165
166
167
168
0
@@ -162,6 +162,7 @@ class RmagickTest < Test::Unit::TestCase
0
       assert_equal 'rails_thumb.png', attachment.thumbnails.first.filename
0
       assert_equal attachment.thumbnails.first.full_filename, attachment.full_filename(attachment.thumbnails.first.thumbnail),
0
         "#full_filename does not use thumbnail class' path."
0
+ assert_equal attachment.destroy attachment
0
     end
0
     
0
     test_against_subclass :test_should_use_thumbnail_subclass, ImageWithThumbsClassFileAttachment

Comments

    No one has commented yet.