Fix calling exists? on Arrays.

This commit is contained in:
Guo Xiang Tan 2017-08-24 09:54:21 +09:00
parent 4b4169c8fd
commit 0531ef2e20
2 changed files with 2 additions and 2 deletions

View File

@ -32,7 +32,7 @@ class PostAnalyzer
cooked_stripped.css("img").reject do |t|
if dom_class = t["class"]
(Post.white_listed_image_classes & dom_class.split).exists?
(Post.white_listed_image_classes & dom_class.split).count > 0
end
end.count
end

View File

@ -243,7 +243,7 @@ class PostSerializer < BasicPostSerializer
summary[:can_defer_flags] = true if scope.is_staff? &&
PostActionType.flag_types.values.include?(id) &&
active_flags.present? && active_flags.has_key?(id) &&
active_flags[id].exists?
active_flags[id].count > 0
end
if actions.present? && actions.has_key?(id)