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/rmm5t/attachment_fu.git
Fixed a nil reference error in sanitize_filename
nbibler (author)
Fri May 16 12:59:54 -0700 2008
commit  61ad36fb73de927ace41689999187076496934df
tree    8d3c8264d6cfc1ca3b11e2e8a9be221d8b06e2f3
parent  6b7bc91a42b058ef175e43f4aa1233bccca4caed
...
371
372
373
 
374
375
376
...
371
372
373
374
375
376
377
0
@@ -371,6 +371,7 @@ module Technoweenie # :nodoc:
0
         end
0
 
0
         def sanitize_filename(filename)
0
+ return unless filename
0
           returning filename.strip do |name|
0
             # NOTE: File.basename doesn't work right with Windows paths on Unix
0
             # get only the filename, not the whole path
...
42
43
44
 
 
 
45
46
47
...
42
43
44
45
46
47
48
49
50
0
@@ -42,6 +42,9 @@ class BasicTest < Test::Unit::TestCase
0
 
0
     @attachment.filename = 'f o!O-.bar'
0
     assert_equal 'f_o_O-.bar', @attachment.filename
0
+
0
+ @attachment.filename = nil
0
+ assert_nil @attachment.filename
0
   end
0
   
0
   def test_should_convert_thumbnail_name

Comments

    No one has commented yet.