Commit 244b7e4e by Jon Yurek

Refactor previous commit.

parent 0238e681
......@@ -35,7 +35,7 @@ module Paperclip
# Returns the filename, the same way as ":basename.:extension" would.
def filename attachment, style_name
(ext = extension(attachment, style_name)).blank? ? basename(attachment, style_name) : "#{basename(attachment, style_name)}.#{ext}"
[ basename(attachment, style_name), extension(attachment, style_name) ].reject(&:blank?).join(".")
end
# Returns the interpolated URL. Will raise an error if the url itself
......
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