diff options
author | Andreas Brandl <abrandl@gitlab.com> | 2018-02-05 12:26:33 +0100 |
---|---|---|
committer | Andreas Brandl <abrandl@gitlab.com> | 2018-02-05 16:16:57 +0100 |
commit | d07addbf6e3841ae31a7e62ecbb29523f4d8c859 (patch) | |
tree | 53ab33b6fb26f99a17870e82c79f05248fbf6503 /app | |
parent | 2fe09e6a12e4f533d77517ddd7fe40fc53522f92 (diff) | |
download | gitlab-ce-d07addbf6e3841ae31a7e62ecbb29523f4d8c859.tar.gz |
Add foreign keys to todos table.
Fixes #32282.
Diffstat (limited to 'app')
-rw-r--r-- | app/models/note.rb | 2 | ||||
-rw-r--r-- | app/models/user.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/app/models/note.rb b/app/models/note.rb index 01a778a7424..cac60845a49 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -60,7 +60,7 @@ class Note < ActiveRecord::Base belongs_to :updated_by, class_name: "User" belongs_to :last_edited_by, class_name: 'User' - has_many :todos, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent + has_many :todos has_many :events, as: :target, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent has_one :system_note_metadata diff --git a/app/models/user.rb b/app/models/user.rb index a57ba3740c9..4b44e9bb7eb 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -125,7 +125,7 @@ class User < ActiveRecord::Base has_many :spam_logs, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent has_many :builds, dependent: :nullify, class_name: 'Ci::Build' # rubocop:disable Cop/ActiveRecordDependent has_many :pipelines, dependent: :nullify, class_name: 'Ci::Pipeline' # rubocop:disable Cop/ActiveRecordDependent - has_many :todos, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent + has_many :todos has_many :notification_settings, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent has_many :award_emoji, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent has_many :triggers, dependent: :destroy, class_name: 'Ci::Trigger', foreign_key: :owner_id # rubocop:disable Cop/ActiveRecordDependent |