Commit 56d6b240 by Fiona Foo & Nate Clark Committed by Jon Yurek

fixes issue where attachment styles are losing format options when rails class caching is turned on

parent bb2d3b01
......@@ -57,7 +57,7 @@ module Paperclip
unless @normalized_styles
@normalized_styles = {}
(@styles.respond_to?(:call) ? @styles.call(self) : @styles).each do |name, args|
@normalized_styles[name] = Paperclip::Style.new(name, args, self)
@normalized_styles[name] = Paperclip::Style.new(name, args.dup, self)
end
end
@normalized_styles
......
......@@ -340,7 +340,7 @@ class AttachmentTest < Test::Unit::TestCase
context "An attachment with styles but no processors defined" do
setup do
rebuild_model :processors => [], :styles => {:something => 1}
rebuild_model :processors => [], :styles => {:something => '1'}
@dummy = Dummy.new
@file = StringIO.new("...")
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment