diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-27 15:13:41 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-27 15:13:41 +0000 |
commit | f50cb4f63fae6f02a0b8d9c3a95f29b3b4f79516 (patch) | |
tree | b6bcddc7b76089f91cc6143d141440cb63adfcbd /app/models/chat_name.rb | |
parent | 0a559c913e4d333f339fcc03b89bfeade9ca0b93 (diff) | |
download | gitlab-ce-f50cb4f63fae6f02a0b8d9c3a95f29b3b4f79516.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/chat_name.rb')
-rw-r--r-- | app/models/chat_name.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/chat_name.rb b/app/models/chat_name.rb index ff3f2663b73..da7312df18b 100644 --- a/app/models/chat_name.rb +++ b/app/models/chat_name.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true class ChatName < ApplicationRecord + include LooseForeignKey + LAST_USED_AT_INTERVAL = 1.hour belongs_to :integration, foreign_key: :service_id @@ -14,6 +16,8 @@ class ChatName < ApplicationRecord validates :user_id, uniqueness: { scope: [:service_id] } validates :chat_id, uniqueness: { scope: [:service_id, :team_id] } + loose_foreign_key :ci_pipeline_chat_data, :chat_name_id, on_delete: :async_delete + # Updates the "last_used_timestamp" but only if it wasn't already updated # recently. # |