Permalink
Browse files

Moved conditional from #post_process_styles to #process_style? method

  • Loading branch information...
1 parent d3db7a1 commit f56e8635a613e8f3abb4c18ea5f0f0aea3c079d6 @jimryan jimryan committed with jyurek Jan 6, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/paperclip/attachment.rb
@@ -427,9 +427,9 @@ def post_process(*style_args) #:nodoc:
end
def post_process_styles(*style_args) #:nodoc:
- post_process_style(:original, styles[:original]) if styles.include?(:original) && (style_args.empty? || style_args.include?(:original))
+ post_process_style(:original, styles[:original]) if styles.include?(:original) && process_style?(:original, style_args)
styles.reject{ |name, style| name == :original }.each do |name, style|
- post_process_style(name, style) if style_args.empty? || style_args.include?(name)
+ post_process_style(name, style) if process_style?(name, style_args)
end
end
@@ -445,6 +445,10 @@ def post_process_style(name, style) #:nodoc:
end
end
+ def process_style?(style_name, style_args) #:nodoc:
+ style_args.empty? || style_args.include?(style_name)
+ end
+
def interpolate(pattern, style_name = default_style) #:nodoc:
interpolator.interpolate(pattern, self, style_name)
end

0 comments on commit f56e863

Please sign in to comment.