Skip to content

Commit 1c75541

Browse files
committed
Use File.extname to get asset extension
1 parent b8e7f83 commit 1c75541

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/models/asset_field_type.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,6 @@ def updated_url(path)
130130
# that will be added later and we don't want to duplicate it
131131
# Then remove the old file extension and replace it with the paperclipp'd new one
132132
new_path = URI.parse(path).path.slice(1..-1)
133-
new_path.gsub(/\.\w{2,6}$/, ".:extension")
133+
new_path.gsub(File.extname(path), ".:extension")
134134
end
135135
end

0 commit comments

Comments
 (0)