mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Switch posts:inline_uploads
scope to be more generic.
This commit is contained in:
parent
c9db897777
commit
eaa7527933
@ -675,9 +675,10 @@ def correct_inline_uploads
|
|||||||
dry_run = (ENV["DRY_RUN"].nil? ? true : ENV["DRY_RUN"] != "false")
|
dry_run = (ENV["DRY_RUN"].nil? ? true : ENV["DRY_RUN"] != "false")
|
||||||
verbose = ENV["VERBOSE"]
|
verbose = ENV["VERBOSE"]
|
||||||
|
|
||||||
scope = Post.joins(:post_uploads)
|
scope = Post.joins(:post_uploads).distinct("posts.id")
|
||||||
.distinct("posts.id")
|
.where(<<~SQL)
|
||||||
.where("raw LIKE '%class=\"attachment%' OR raw LIKE '%<img src=\"%'")
|
raw LIKE '%/uploads/#{RailsMultisite::ConnectionManagement.current_db}/original/%'
|
||||||
|
SQL
|
||||||
|
|
||||||
affected_posts_count = scope.count
|
affected_posts_count = scope.count
|
||||||
fixed_count = 0
|
fixed_count = 0
|
||||||
|
Loading…
Reference in New Issue
Block a user