public
Description: A mirror of the mephisto code-base
Homepage: http://mephistoblog.com/
Clone URL: git://github.com/halorgium/mephisto.git
Search Repo:
Merge branch 'rel-0.8'
technoweenie (author)
Tue Mar 04 01:39:15 -0800 2008
commit  2c876c3f03bcad10afd19f7a361ea18aadb773c2
tree    7ee9208d984481ce9c8ce4f48e7dc81973ef0ed5
parent  5b7d39d435a4aa2e78025fae57a2ef442fb8f981 parent  3afcdaeac833515e2378c826fca7b1505aa48bb4
...
85
86
87
88
 
89
90
91
...
85
86
87
 
88
89
90
91
0
@@ -85,7 +85,7 @@
0
 
0
   protected
0
     def rename_unique_filename
0
- if (@old_filename || new_record?) && errors.empty? && site_id && filename
0
+ if ((@old_filename && !@old_filename.eql?(full_filename)) || new_record?) && errors.empty? && site_id && filename
0
         i = 1
0
         pieces = filename.split('.')
0
         ext = pieces.size == 1 ? nil : pieces.pop
...
44
45
46
 
 
 
 
 
 
 
47
48
49
...
44
45
46
47
48
49
50
51
52
53
54
55
56
0
@@ -44,6 +44,13 @@
0
     assert_file_exists File.join(ASSET_PATH, now.year.to_s, now.month.to_s, now.day.to_s, "logo_1.png")
0
   end
0
 
0
+ def test_should_not_rename_file_on_update
0
+ asset = process_upload
0
+ old_filename = asset.filename
0
+ asset.update_attributes({ :filename => 'logo.png' })
0
+ assert_equal old_filename, asset.filename
0
+ end
0
+
0
   def test_should_upload_file_in_multi_sites_mode
0
     Site.multi_sites_enabled = true
0
     process_upload

Comments

    No one has commented yet.