From 49ddd12cc2583bc4781ac29bc1019e3ff810abd5 Mon Sep 17 00:00:00 2001 From: Robert Pankowecki Date: Fri, 2 Mar 2012 00:39:02 +0100 Subject: [PATCH] Updated "Events" section in README to include example of hook for skipping post processing. --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index f5d252671..2a972d908 100644 --- a/README.md +++ b/README.md @@ -259,6 +259,16 @@ _NOTE: Post processing will not even *start* if the attachment is not valid according to the validations. Your callbacks and processors will *only* be called with valid attachments._ + class Message < ActiveRecord::Base + has_attached_file :asset, styles: {thumb: "100x100#"} + + before_post_process :skip_for_audio + + def skip_for_audio + return false if %w(audio/ogg application/ogg).include?(asset_content_type) + end + end + URI Obfuscation ---------------