Fix various rubocop warnings.

This commit is contained in:
evazion
2021-09-27 00:44:41 -05:00
parent a2a4ab887d
commit 79fdfa86ae
39 changed files with 149 additions and 154 deletions

View File

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