diff --git a/lib/technoweenie/attachment_fu.rb b/lib/technoweenie/attachment_fu.rb index e282825b..bd5bd1f1 100644 --- a/lib/technoweenie/attachment_fu.rb +++ b/lib/technoweenie/attachment_fu.rb @@ -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