Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@kylefox
Created April 18, 2010 17:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kylefox/370433 to your computer and use it in GitHub Desktop.
Save kylefox/370433 to your computer and use it in GitHub Desktop.
# How do I get Paperclip's post processor callbacks to run?
# The methods below don't seem to work.
# http://groups.google.com/group/paperclip-plugin/browse_thread/thread/d4ee841d5a7e00b2
####################################
# Define `after_post_process` in the model
class Photo < ActiveRecord::Base
has_attached_file :image
def after_post_process
puts "This doesn't execute."
end
end
####################################
# Define `after_<attachment>_process` in the model
class Photo < ActiveRecord::Base
has_attached_file :image
def after_image_post_process
puts "This doesn't execute."
end
end
####################################
# Specify `after_post_process` as an option
class Photo < ActiveRecord::Base
has_attached_file :image,
:after_post_process => :do_something
def do_something
puts "This doesn't execute."
end
end
####################################
# Specify `after_<attachment>_post_process` as an option
class Photo < ActiveRecord::Base
has_attached_file :image,
:after_image_post_process => :do_something
def do_something
puts "This doesn't execute."
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment