about summary refs log tree commit diff
path: root/db
diff options
context:
space:
mode:
authorNick Schonning <nschonni@gmail.com>2023-02-19 20:19:40 -0500
committerGitHub <noreply@github.com>2023-02-20 02:19:40 +0100
commit597767a9f7ca846be9fbca826aba362f8387a60f (patch)
treec25188e552be7112fecc4654c0e25ed2ebd4768d /db
parent8ef09813a2b46d99fe9c7e39beba2a68052c17d1 (diff)
Autofix Rubocop Rails/RedundantForeignKey (#23731)
Diffstat (limited to 'db')
-rw-r--r--db/post_migrate/20221101190723_backfill_admin_action_logs.rb2
-rw-r--r--db/post_migrate/20221206114142_backfill_admin_action_logs_again.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/db/post_migrate/20221101190723_backfill_admin_action_logs.rb b/db/post_migrate/20221101190723_backfill_admin_action_logs.rb
index 48ef1e6e3..6ab76a8f7 100644
--- a/db/post_migrate/20221101190723_backfill_admin_action_logs.rb
+++ b/db/post_migrate/20221101190723_backfill_admin_action_logs.rb
@@ -62,7 +62,7 @@ class BackfillAdminActionLogs < ActiveRecord::Migration[6.1]
     # Cannot use usual polymorphic support because of namespacing issues
     belongs_to :status, foreign_key: :target_id
     belongs_to :account, foreign_key: :target_id
-    belongs_to :user, foreign_key: :user_id
+    belongs_to :user
     belongs_to :domain_block, foreign_key: :target_id
     belongs_to :domain_allow, foreign_key: :target_id
     belongs_to :email_domain_block, foreign_key: :target_id
diff --git a/db/post_migrate/20221206114142_backfill_admin_action_logs_again.rb b/db/post_migrate/20221206114142_backfill_admin_action_logs_again.rb
index 279053ab9..42b7f3625 100644
--- a/db/post_migrate/20221206114142_backfill_admin_action_logs_again.rb
+++ b/db/post_migrate/20221206114142_backfill_admin_action_logs_again.rb
@@ -62,7 +62,7 @@ class BackfillAdminActionLogsAgain < ActiveRecord::Migration[6.1]
     # Cannot use usual polymorphic support because of namespacing issues
     belongs_to :status, foreign_key: :target_id
     belongs_to :account, foreign_key: :target_id
-    belongs_to :user, foreign_key: :user_id
+    belongs_to :user
     belongs_to :domain_block, foreign_key: :target_id
     belongs_to :domain_allow, foreign_key: :target_id
     belongs_to :email_domain_block, foreign_key: :target_id