Commit fe06db45 by Jon Yurek

Convert attachment definition keys to strings for comparison

parent e705b737
...@@ -10,7 +10,7 @@ module Paperclip ...@@ -10,7 +10,7 @@ module Paperclip
klass = Paperclip.class_for(klass.to_s) klass = Paperclip.class_for(klass.to_s)
name = ENV['ATTACHMENT'] || ENV['attachment'] name = ENV['ATTACHMENT'] || ENV['attachment']
raise "Class #{klass.name} has no attachments specified" unless klass.respond_to?(:attachment_definitions) raise "Class #{klass.name} has no attachments specified" unless klass.respond_to?(:attachment_definitions)
if !name.blank? && klass.attachment_definitions.keys.include?(name) if !name.blank? && klass.attachment_definitions.keys.map(&:to_s).include?(name.to_s)
[ name ] [ name ]
else else
klass.attachment_definitions.keys klass.attachment_definitions.keys
......
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