DEV: Avoid using send and make the method public instead.

This commit is contained in:
Guo Xiang Tan 2018-09-13 16:34:32 +08:00
parent 0a06b3d977
commit 529e4018f0
2 changed files with 3 additions and 4 deletions

View File

@ -127,8 +127,6 @@ class PostAnalyzer
raw_links.size
end
private
def cooked_stripped
@cooked_stripped ||= begin
doc = Nokogiri::HTML.fragment(cook(@raw, topic_id: @topic_id))
@ -137,6 +135,8 @@ class PostAnalyzer
end
end
private
def link_is_a_mention?(l)
html_class = l['class']
return false if html_class.blank?

View File

@ -7,9 +7,8 @@ class UploadRecovery
posts.where("raw LIKE '%upload:\/\/%'").find_each do |post|
begin
analyzer = PostAnalyzer.new(post.raw, post.topic_id)
cooked_stripped = analyzer.send(:cooked_stripped)
cooked_stripped.css("img").each do |img|
analyzer.cooked_stripped.css("img").each do |img|
if dom_class = img["class"]
if (Post.white_listed_image_classes & dom_class.split).count > 0
next