0
0
Fork 0

Group common class_name options in associations (#28779)

This commit is contained in:
Matt Jankowski 2024-01-18 07:29:41 -05:00 committed by GitHub
parent da31792ac7
commit aaa6f2e930
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 24 additions and 11 deletions

View file

@ -29,9 +29,12 @@ class Report < ApplicationRecord
rate_limit by: :account, family: :reports
belongs_to :account
belongs_to :target_account, class_name: 'Account'
belongs_to :action_taken_by_account, class_name: 'Account', optional: true
belongs_to :assigned_account, class_name: 'Account', optional: true
with_options class_name: 'Account' do
belongs_to :target_account
belongs_to :action_taken_by_account, optional: true
belongs_to :assigned_account, optional: true
end
has_many :notes, class_name: 'ReportNote', inverse_of: :report, dependent: :destroy
has_many :notifications, as: :activity, dependent: :destroy