FIX: should look through posts for image markdown

Downloaded onebox images only included in the cooked HTML content. So we have to check 'post.cooked' instead of 'raw'. bfdd0fe64c
This commit is contained in:
Vinoth Kannan
2019-04-10 13:52:35 +05:30
parent 9c1d1777db
commit d0fe42e2ef
4 changed files with 37 additions and 9 deletions

View File

@@ -108,6 +108,13 @@ class Post < ActiveRecord::Base
end
}
scope :have_uploads, -> {
where(
"(posts.cooked LIKE '%<a %' OR posts.cooked LIKE '%<img %') AND posts.cooked LIKE ?",
"%/uploads/#{RailsMultisite::ConnectionManagement.current_db}/%"
)
}
delegate :username, to: :user
def self.hidden_reasons