Commit 94eb2916 by Jon Yurek

Formatting and anchoring the extension gsub to the end

parent 7d29d06d
...@@ -169,7 +169,7 @@ module Paperclip ...@@ -169,7 +169,7 @@ module Paperclip
attachment.instance.class.name.underscore.pluralize attachment.instance.class.name.underscore.pluralize
end, end,
:basename => lambda do |attachment,style| :basename => lambda do |attachment,style|
attachment.original_filename.gsub(File.extname(attachment.original_filename), "") attachment.original_filename.gsub(/#{File.extname(attachment.original_filename)}$/, "")
end, end,
:extension => lambda do |attachment,style| :extension => lambda do |attachment,style|
((style = attachment.styles[style]) && style.last) || ((style = attachment.styles[style]) && style.last) ||
......
...@@ -174,7 +174,6 @@ class AttachmentTest < Test::Unit::TestCase ...@@ -174,7 +174,6 @@ class AttachmentTest < Test::Unit::TestCase
should "strip whitespace from content_type field" do should "strip whitespace from content_type field" do
assert_equal "image/png", @dummy.avatar.instance.avatar_content_type assert_equal "image/png", @dummy.avatar.instance.avatar_content_type
end end
end end
context "Attachment with strange letters" do context "Attachment with strange letters" do
......
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