Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #1 from mconf/master

Fixes for Rails 3.1
  • Loading branch information...
commit 5c58672ef46628b9dcfc40f7e2944d9159ab8c2d 2 parents 828ea99 + 746363b
@thbar thbar authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/technoweenie/attachment_fu.rb
View
8 lib/technoweenie/attachment_fu.rb
@@ -177,7 +177,7 @@ def image?(content_type)
end
def self.extended(base)
- base.class_inheritable_accessor :attachment_options
+ base.class_attribute :attachment_options
base.before_destroy :destroy_thumbnails
base.before_validation :set_size_from_temp_path
base.after_save :after_process_attachment
@@ -290,11 +290,11 @@ 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"))
find_or_initialize_thumbnail(file_name_suffix).tap do |thumb|
thumb.temp_paths.unshift temp_file
- thumb.send(:'attributes=', {
+ thumb.assign_attributes({
:content_type => content_type,
:filename => thumbnail_name_for(file_name_suffix),
:thumbnail_resize_options => size
- }, false)
+ }, :without_protection => true)
callback_with_args :before_thumbnail_saved, thumb
thumb.save!
end
@@ -482,7 +482,7 @@ def resize_image_or_thumbnail!(img)
if defined?(Rails) && Rails::VERSION::MAJOR >= 3
def callback_with_args(method, arg = self)
if respond_to?(method)
- send(method, arg)
+ send(method, arg)
end
end
# Yanked from ActiveRecord::Callbacks, modified so I can pass args to the callbacks besides self.
Please sign in to comment.
Something went wrong with that request. Please try again.