posts: remove rating, note, and status locks.

Remove the ability for users to lock ratings, note, and post statuses.

Historically the majority of locked posts were from 10+ years ago when
certain users habitually locked ratings and notes on every post they
touched for no reason. Nowadays most posts have been unlocked. Only a
handful of locked posts are left, none of which deserve to be locked.

The is_rating_locked, is_note_locked, and is_status_locked columns still
exist in the database, but aren't used.
This commit is contained in:
evazion
2021-09-27 21:56:41 -05:00
parent 3e4492ce33
commit 126046cb69
13 changed files with 39 additions and 447 deletions

View File

@@ -13,7 +13,6 @@ class Note < ApplicationRecord
validate :note_within_image
after_save :update_post
after_save :create_version
validate :validate_post_is_not_locked
scope :active, -> { where(is_active: true) }
@@ -28,10 +27,6 @@ class Note < ApplicationRecord
extend SearchMethods
def validate_post_is_not_locked
errors.add(:post, "is note locked") if post.is_note_locked?
end
def note_within_image
return false unless post.present?
if x < 0 || y < 0 || (x > post.image_width) || (y > post.image_height) || width < 0 || height < 0 || (x + width > post.image_width) || (y + height > post.image_height)