Skip to content

Commit

Permalink
failsafe wasn't working if image got overriden
Browse files Browse the repository at this point in the history
  • Loading branch information
parndt committed Sep 3, 2009
1 parent 81e725c commit f18cf66
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vendor/plugins/refinery/app/helpers/application_helper.rb
Expand Up @@ -41,8 +41,8 @@ def selected_page?(page)

def image_fu(image, thumbnail, options={})
begin
image = image.thumbnails.reject!{|t| t.thumbnail != thumbnail.to_s}.first unless thumbnail.nil?
image_tag image.public_filename, {:width => image.width, :height => image.height}.merge!(options)
image_to_use = thumbnail.nil? ? image : image.thumbnails.reject!{|t| t.thumbnail != thumbnail.to_s}.first
image_tag image_to_use.public_filename, {:width => image_to_use.width, :height => image_to_use.height}.merge!(options)
rescue
image_tag image.public_filename(thumbnail), options
end
Expand Down

0 comments on commit f18cf66

Please sign in to comment.