According to current Paperclip docs, lambda is called differently for processors than for styles. Styles passed attachment:
class User < ActiveRecord::Base has_attached_file :avatar, :styles => lambda { |attachment| { :thumb => (attachment.instance.boss? ? "300x300>" : "100x100>") } } end
With attachment.instance is an instance of your model. But the processors are passed by the instance itself:
class User < ActiveRecord::Base has_attached_file :avatar, :processors => lambda { |instance| instance.processors } attr_accessor :watermark end
This last example worked for me. I had User#processors return an array of processors (but if you just want the default processor, return [:thumbnail] , not an empty array).
source share