From ba18631495aa644901f90ea0b2b3c55b523e4e17 Mon Sep 17 00:00:00 2001 From: Daniel Vartanov Date: Tue, 4 Oct 2011 16:35:56 +0600 Subject: [PATCH] Paperclip::Style. Much more efficient initialization in case of string definition. --- lib/paperclip/style.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/paperclip/style.rb b/lib/paperclip/style.rb index 0ef6c7fe6..1615d0ca0 100644 --- a/lib/paperclip/style.rb +++ b/lib/paperclip/style.rb @@ -19,6 +19,10 @@ def initialize name, definition, attachment @format = definition.delete(:format) @processors = definition.delete(:processors) @other_args = definition + elsif definition.is_a? String + @geometry = definition + @format = nil + @other_args = {} else @geometry, @format = [definition, nil].flatten[0..1] @other_args = {}