public
Description: Rails plugin for uploading images as resources, with support for resizing, text stamping, and other special effects.
Homepage: http://fleximage.rubyforge.org
Clone URL: git://github.com/Squeegy/fleximage.git
refactored has_image?
Squeegy (author)
Tue Apr 15 09:06:56 -0700 2008
commit  78e4f66f324fd2c8f032dee29b7f5e405650142a
tree    11a3bdd12c3eae32559fa73c5bbb14f965f875cc
parent  b532e66a17a5396a45006fc34a0a304626f2c217
...
281
282
283
284
285
286
287
288
289
290
 
 
 
 
 
291
292
293
...
281
282
283
 
 
 
 
 
 
 
284
285
286
287
288
289
290
291
0
@@ -281,13 +281,11 @@ module Fleximage
0
       
0
       # Return true if this record has an image.
0
       def has_image?
0
- instance_image = @uploaded_image || @output_image
0
-
0
- if instance_image
0
- instance_image
0
- else
0
- self.class.db_store? ? image_file_data : File.exists?(file_path)
0
- end
0
+ @uploaded_image || @output_image || has_saved_image?
0
+ end
0
+
0
+ def has_saved_image?
0
+ self.class.db_store? ? !!image_file_data : File.exists?(file_path)
0
       end
0
       
0
       # Call from a .flexi view template. This enables the rendering of operators

Comments

    No one has commented yet.