DEV: Fix rubocop issues (#14715)

This commit is contained in:
Dan Ungureanu
2021-10-27 11:39:28 +03:00
committed by GitHub
parent 6aa6275f3f
commit 69f0f48dc0
27 changed files with 65 additions and 69 deletions

View File

@@ -117,8 +117,8 @@ class TopicEmbed < ActiveRecord::Base
follow_canonical: true,
)
url = fd.resolve
return if url.blank?
uri = fd.resolve
return if uri.blank?
opts = {
tags: %w[div p code pre h1 h2 h3 b em i strong a img ul li ol blockquote],
@@ -132,7 +132,7 @@ class TopicEmbed < ActiveRecord::Base
response = FetchResponse.new
begin
html = open(url, allow_redirections: :safe).read
html = uri.read(allow_redirections: :safe)
rescue OpenURI::HTTPError, Net::OpenTimeout
return
end
@@ -256,10 +256,6 @@ class TopicEmbed < ActiveRecord::Base
body
end
end
def self.open(uri, **kwargs)
URI.open(uri, **kwargs)
end
end
# == Schema Information