public
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/technoweenie/attachment_fu.git
Click here to lend your support to: attachment_fu and make a donation at www.pledgie.com !
Fixed broken tests that were caused by previous commit related to
http://ar-code.lighthouseapp.com/projects/35-attachment_fu/tickets/20
rmm5t (author)
Sat Mar 15 10:50:11 -0700 2008
technoweenie (committer)
Sat Mar 15 15:22:54 -0700 2008
commit  18c0b2d5c9c153d6d71dec97e04e155d7faffa99
tree    316bb5afe02c86df9a60e85b768d4800d675d3d3
parent  ee40198a75b1c9be963f61d46fea6601464b3019
...
71
72
73
74
75
 
 
76
77
78
...
71
72
73
 
 
74
75
76
77
78
0
@@ -71,8 +71,8 @@ module Technoweenie # :nodoc:
0
 
0
         with_options :foreign_key => 'parent_id' do |m|
0
           m.has_many :thumbnails, :class_name => attachment_options[:thumbnail_class].to_s
0
- m.belongs_to :parent, :class_name => base_class.to_s
0
- end unless options[:thumbnails].empty?
0
+ m.belongs_to :parent, :class_name => base_class.to_s unless options[:thumbnails].empty?
0
+ end
0
 
0
         storage_mod = Technoweenie::AttachmentFu::Backends.const_get("#{options[:storage].to_s.classify}Backend")
0
         include storage_mod unless included_modules.include?(storage_mod)
...
157
158
159
160
161
 
 
 
 
162
163
164
...
250
251
252
253
254
 
...
157
158
159
 
 
160
161
162
163
164
165
166
...
252
253
254
 
255
256
0
@@ -157,8 +157,10 @@ class RmagickTest < Test::Unit::TestCase
0
         assert_valid attachment
0
       end
0
       assert_kind_of ImageThumbnail, attachment.thumbnails.first
0
- assert_equal attachment.id, attachment.thumbnails.first.parent.id
0
- assert_kind_of FileAttachment, attachment.thumbnails.first.parent
0
+ if attachment.thumbnails.first.respond_to?(:parent)
0
+ assert_equal attachment.id, attachment.thumbnails.first.parent.id
0
+ assert_kind_of FileAttachment, attachment.thumbnails.first.parent
0
+ end
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
@@ -250,4 +252,4 @@ class RmagickTest < Test::Unit::TestCase
0
       puts "RMagick not installed, no tests running"
0
     end
0
   end
0
-end
0
\ No newline at end of file
0
+end

Comments

    No one has commented yet.