posts: clean up delete! method.

* Remove unused `ban` and `without_mod_action` options.

* Don't try to set the `is_banned` flag during deletion.

* Don't create modactions for automatic "unapproved in 3 days"
  deletions, only to delete them after the fact.
This commit is contained in:
evazion
2020-08-03 20:00:47 -05:00
parent bca1f122d0
commit 157cb96551
4 changed files with 18 additions and 46 deletions

View File

@@ -13,7 +13,7 @@ class PostFlag < ApplicationRecord
validates :reason, presence: true, length: { in: 1..140 }
validate :validate_creator_is_not_limited, on: :create
validate :validate_post
validates_uniqueness_of :creator_id, :scope => :post_id, :on => :create, :unless => :is_deletion, :message => "have already flagged this post"
validates_uniqueness_of :creator_id, scope: :post_id, on: :create, unless: :is_deletion, message: "have already flagged this post"
before_save :update_post
attr_accessor :is_deletion