Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions lib/technoweenie/attachment_fu.rb
Original file line number Diff line number Diff line change
Expand Up @@ -290,11 +290,16 @@ def create_or_update_thumbnail(temp_file, file_name_suffix, *size)
thumbnailable? || raise(ThumbnailError.new("Can't create a thumbnail if the content type is not an image or there is no parent_id column"))
returning find_or_initialize_thumbnail(file_name_suffix) do |thumb|
thumb.temp_paths.unshift temp_file
thumb.send(:'attributes=', {
thumb_attributes= {
:content_type => content_type,
:filename => thumbnail_name_for(file_name_suffix),
:thumbnail_resize_options => size
}, false)
}
if Rails::VERSION::MAJOR == 1
thumb.send(:'attributes=', thumb_attributes)
else
thumb.send(:'attributes=', thumb_attributes ,false)
end
callback_with_args :before_thumbnail_saved, thumb
thumb.save!
end
Expand Down