Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Quick fix for creating thumbnails

  • Loading branch information...
commit 9d754014744b039d82e3e55b3cc7f7c35c16ab08 1 parent cda2d14
@solum13 solum13 authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/technoweenie/attachment_fu.rb
View
8 lib/technoweenie/attachment_fu.rb
@@ -167,7 +167,7 @@ def self.extended(base)
base.after_save :after_process_attachment
base.after_destroy :destroy_file
base.after_validation :process_attachment
- base.attr_accessible
+ base.attr_accessible :uploaded_data
if defined?(::ActiveSupport::Callbacks)
base.define_callbacks :after_resize, :after_attachment_saved, :before_thumbnail_saved
end
@@ -274,12 +274,12 @@ def thumbnail_name_for(thumbnail = nil)
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.attributes = {
+ thumb.temp_paths.unshift temp_file
+ thumb.send(:'attributes=', {
:content_type => content_type,
:filename => thumbnail_name_for(file_name_suffix),
- :temp_path => temp_file,
:thumbnail_resize_options => size
- }
+ }, false)
callback_with_args :before_thumbnail_saved, thumb
thumb.save!
end
Please sign in to comment.
Something went wrong with that request. Please try again.