Files
danbooru/script/fixes/073_change_default_comment_threshold.rb
evazion 9af407c94b comments: set default comment threshold to -8.
* Set the default comment threshold to -8. This means that comments are
  hidden at -8 or lower and greyed out at -4 or lower.

* Reset the comment threshold to -8 for anyone with a threshold greater
  than -8. For reference, only about ~3100 users had a non-default
  threshold. About 1600 of those had their threshold reset to -8.

* Change the comment threshold to a less-than-or-equal comparison
  instead of a less-than comparsion. This means that a threshold of 0
  before is the same as a threshold of -1 now. Since everyone's
  thresholds were reset, this only affects people whose thresholds were
  already less than -8, which is so low that the difference shouldn't
  matter much.

* Set the maximum comment threshold to 5. For reference, less than 1% of
  comments have a score greater than 5.

* Set the minimum comment threshold to -100. For reference, the most
  downvoted comment has a score of -60.
2021-01-19 05:48:25 -06:00

14 lines
371 B
Ruby
Executable File

#!/usr/bin/env ruby
require_relative "../../config/environment"
User.transaction do
users = User.where("comment_threshold > ?", User.anonymous.comment_threshold)
p users.count
users.update_all(comment_threshold: User.anonymous.comment_threshold)
users = User.where("comment_threshold < ?", -100)
p users.count
users.update_all(comment_threshold: -100)
end