rubocop: fix various Rubocop warnings.

This commit is contained in:
evazion
2021-06-16 18:24:42 -05:00
parent cfe471e0b5
commit 07e23204b6
99 changed files with 412 additions and 374 deletions

View File

@@ -7,8 +7,8 @@ class CommentVote < ApplicationRecord
validate :validate_vote_is_unique, if: :is_deleted_changed?
validates :score, inclusion: { in: [-1, 1], message: "must be 1 or -1" }
before_create :update_score_on_create
before_save :update_score_on_delete_or_undelete, if: -> { !new_record? && is_deleted_changed? }
before_create :update_score_on_create
deletable