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.
This commit is contained in:
evazion
2021-01-19 05:15:02 -06:00
parent e1e3604f46
commit 9af407c94b
5 changed files with 31 additions and 5 deletions

View File

@@ -81,7 +81,7 @@ class User < ApplicationRecord
attribute :last_logged_in_at, default: -> { Time.zone.now }
attribute :last_forum_read_at, default: "1960-01-01 00:00:00"
attribute :last_ip_addr
attribute :comment_threshold, default: 0
attribute :comment_threshold, default: -8
attribute :default_image_size, default: "large"
attribute :favorite_tags
attribute :blacklisted_tags, default: DEFAULT_BLACKLIST
@@ -108,7 +108,7 @@ class User < ApplicationRecord
validates_inclusion_of :default_image_size, :in => %w(large original)
validates_inclusion_of :per_page, in: (1..PostSets::Post::MAX_PER_PAGE)
validates_confirmation_of :password
validates_presence_of :comment_threshold
validates :comment_threshold, inclusion: { in: (-100..5) }
before_validation :normalize_blacklisted_tags
before_create :promote_to_admin_if_first_user
has_many :artist_versions, foreign_key: :updater_id