How can I skip post processing based on a virtual attribute?
My virtual attribute is always nil in the before_asset_post_process callback
Create
attachment = Attachment.create(asset: File.open(file.png), :skip_thumb => 1)
Attachable model
class Attachment < AR::Base
attr_accessor :skip_thumb
has_attached_file :asset, :styles => lambda { |attachment| { :thumb => ["100>", 'jpg'] ,
:thumb_big => ["200>", 'jpg']
}
before_asset_post_process :proceed_or_cancel
def proceed_or_cancel
#self.skip_thumb is always nil
if (self.skip_thumb.present?)
return false
end
end
end