From cbd9106a87538d3cc2d00d1d49d40dffbbf43938 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Tue, 19 Jul 2022 00:01:00 +0200 Subject: [PATCH] Remove `ModerationComment` model, relations and methods --- app/models/moderation_comment.rb | 8 -------- app/models/report.rb | 1 - app/models/user.rb | 5 ----- 3 files changed, 14 deletions(-) delete mode 100644 app/models/moderation_comment.rb diff --git a/app/models/moderation_comment.rb b/app/models/moderation_comment.rb deleted file mode 100644 index d0baa654..00000000 --- a/app/models/moderation_comment.rb +++ /dev/null @@ -1,8 +0,0 @@ -class ModerationComment < ApplicationRecord - belongs_to :user - belongs_to :report - validates :user_id, presence: true - validates :report_id, presence: true - - validates :content, length: { maximum: 160 } -end diff --git a/app/models/report.rb b/app/models/report.rb index 3d184f08..1c8aad7c 100644 --- a/app/models/report.rb +++ b/app/models/report.rb @@ -1,6 +1,5 @@ class Report < ApplicationRecord belongs_to :user - has_many :moderation_comments, dependent: :destroy validates :type, presence: true validates :target_id, presence: true validates :user_id, presence: true diff --git a/app/models/user.rb b/app/models/user.rb index e7e1f030..84d8fb9d 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -35,7 +35,6 @@ class User < ApplicationRecord has_many :services, dependent: :destroy_async has_many :notifications, foreign_key: :recipient_id, dependent: :destroy_async has_many :reports, dependent: :destroy_async - has_many :moderation_comments, dependent: :destroy_async has_many :lists, dependent: :destroy_async has_many :list_memberships, class_name: "ListMember", dependent: :destroy_async has_many :mute_rules, dependent: :destroy_async @@ -154,10 +153,6 @@ class User < ApplicationRecord existing end end - - def report_comment(report, content) - ModerationComment.create!(user: self, report: report, content: content) - end # endregion def can_export?