Autofix Rubocop Rails/RedundantForeignKey (#23731)
This commit is contained in:
parent
8ef09813a2
commit
597767a9f7
8 changed files with 8 additions and 20 deletions
|
@ -33,8 +33,8 @@ class CustomFilter < ApplicationRecord
|
|||
enum action: [:warn, :hide], _suffix: :action
|
||||
|
||||
belongs_to :account
|
||||
has_many :keywords, class_name: 'CustomFilterKeyword', foreign_key: :custom_filter_id, inverse_of: :custom_filter, dependent: :destroy
|
||||
has_many :statuses, class_name: 'CustomFilterStatus', foreign_key: :custom_filter_id, inverse_of: :custom_filter, dependent: :destroy
|
||||
has_many :keywords, class_name: 'CustomFilterKeyword', inverse_of: :custom_filter, dependent: :destroy
|
||||
has_many :statuses, class_name: 'CustomFilterStatus', inverse_of: :custom_filter, dependent: :destroy
|
||||
accepts_nested_attributes_for :keywords, reject_if: :all_blank, allow_destroy: true
|
||||
|
||||
validates :title, :context, presence: true
|
||||
|
|
|
@ -12,7 +12,7 @@ class FollowRecommendation < ApplicationRecord
|
|||
self.primary_key = :account_id
|
||||
|
||||
belongs_to :account_summary, foreign_key: :account_id
|
||||
belongs_to :account, foreign_key: :account_id
|
||||
belongs_to :account
|
||||
|
||||
scope :localized, ->(locale) { joins(:account_summary).merge(AccountSummary.localized(locale)) }
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ class Report < ApplicationRecord
|
|||
belongs_to :action_taken_by_account, class_name: 'Account', optional: true
|
||||
belongs_to :assigned_account, class_name: 'Account', optional: true
|
||||
|
||||
has_many :notes, class_name: 'ReportNote', foreign_key: :report_id, inverse_of: :report, dependent: :destroy
|
||||
has_many :notes, class_name: 'ReportNote', inverse_of: :report, dependent: :destroy
|
||||
has_many :notifications, as: :activity, dependent: :destroy
|
||||
|
||||
scope :unresolved, -> { where(action_taken_at: nil) }
|
||||
|
|
|
@ -53,7 +53,7 @@ class Status < ApplicationRecord
|
|||
belongs_to :application, class_name: 'Doorkeeper::Application', optional: true
|
||||
|
||||
belongs_to :account, inverse_of: :statuses
|
||||
belongs_to :in_reply_to_account, foreign_key: 'in_reply_to_account_id', class_name: 'Account', optional: true
|
||||
belongs_to :in_reply_to_account, class_name: 'Account', optional: true
|
||||
belongs_to :conversation, optional: true
|
||||
belongs_to :preloadable_poll, class_name: 'Poll', foreign_key: 'poll_id', optional: true
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
class UserIp < ApplicationRecord
|
||||
self.primary_key = :user_id
|
||||
|
||||
belongs_to :user, foreign_key: :user_id
|
||||
belongs_to :user
|
||||
|
||||
def readonly?
|
||||
true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue