lib/paperclip/interpolations.rb in paperclip-2.6.0 vs lib/paperclip/interpolations.rb in paperclip-2.7.0
- old
+ new
@@ -91,10 +91,10 @@
# Returns the extension of the file. e.g. "jpg" for "file.jpg"
# If the style has a format defined, it will return the format instead
# of the actual extension.
def extension attachment, style_name
- ((style = attachment.styles[style_name]) && style[:format]) ||
+ ((style = attachment.styles[style_name.to_sym]) && style[:format]) ||
File.extname(attachment.original_filename).gsub(/^\.+/, "")
end
# Returns an extension based on the content type. e.g. "jpeg" for "image/jpeg".
# Each mime type generally has multiple extensions associated with it, so