public
Description: Easily upload files to your Ruby on Rails application
Homepage: http://uploadcolumn.rubyforge.org/
Clone URL: git://github.com/jnicklas/uploadcolumn.git
fixed problem with multiple edits

git-svn-id: http://uploadcolumn.rubyforge.org/svn/trunk@109 
02338ee4-8dee-4235-8d26-5b68cf25713b
jnicklas (author)
Wed Apr 09 11:16:18 -0700 2008
commit  63d2657bc37d74b715acf126d46dbfb0f8671c34
tree    2ec8a8dc2c6719665f73b742fa1cb7cef7f99b39
parent  cbb621379a5e198cc2863449a21750989cd74e78
...
169
170
171
172
173
174
175
 
 
 
 
 
 
176
177
178
...
169
170
171
 
 
 
 
172
173
174
175
176
177
178
179
180
0
@@ -169,10 +169,12 @@ module UploadColumn
0
     
0
     # this is the value returned when avatar_temp is called, where avatar is an upload_column
0
     def temp_value #:nodoc:
0
- if original_filename
0
- %(#{@temp_name}/#{filename};#{original_filename})
0
- else
0
- %(#{@temp_name}/#{filename})
0
+ if tempfile?
0
+ if original_filename
0
+ %(#{@temp_name}/#{filename};#{original_filename})
0
+ else
0
+ %(#{@temp_name}/#{filename})
0
+ end
0
       end
0
     end
0
     
...
1039
1040
1041
 
 
 
 
 
 
 
 
 
 
 
1042
1043
...
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
0
@@ -1039,4 +1039,15 @@ describe "the temp_value of a retrieved temporary UploadedFile" do
0
   it "should be mainatained" do
0
     @file.temp_value.should == '12345.1234.12345/kerb.jpg'
0
   end
0
+end
0
+
0
+describe "the temp_value of an UploadedFile that is not temporary" do
0
+
0
+ setup do
0
+ @file = UploadColumn::UploadedFile.retrieve('kerb.jpg', nil, :donkey)
0
+ end
0
+
0
+ it "should be mainatained" do
0
+ @file.temp_value.should be_nil
0
+ end
0
 end
0
\ No newline at end of file

Comments

    No one has commented yet.