Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Commit

Permalink
Moved conditional from #post_process_styles to #process_style? method
Browse files Browse the repository at this point in the history
  • Loading branch information
jimryan authored and Jon Yurek committed Jan 9, 2012
1 parent d3db7a1 commit f56e863
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/paperclip/attachment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down

0 comments on commit f56e863

Please sign in to comment.