Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Ruby to version 2.7.4 #4662

Merged
merged 3 commits into from
Sep 8, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Prev Previous commit
Next Next commit
Supress warnings in Paperclip::UrlGenerator
We were getting hundreds of "warning: URI.escape is obsolete" messages.
So we're using `URI::DEFAULT_PARSER.escape` instead.

IMHO it's OK to add this monkey-patch because we're replacing Paperclip
with Active Storage, and when we finish with that we'll delete this
file.
  • Loading branch information
javierm committed Sep 3, 2021
commit 4f4f8f61801b1042a799c7c91d0a1361461f21a1
13 changes: 13 additions & 0 deletions config/initializers/paperclip.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
class Paperclip::UrlGenerator
private

# Code copied from the paperclip gem, only replacing
# `URI.escape` with `URI::DEFAULT_PARSER.escape`
def escape_url(url)
if url.respond_to?(:escape)
url.escape
else
URI::DEFAULT_PARSER.escape(url).gsub(escape_regex) { |m| "%#{m.ord.to_s(16).upcase}" }
end
end
end