diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-20 16:49:51 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-20 16:49:51 +0300 |
commit | 71786ddc8e28fbd3cb3fcc4b3ff15e5962a1c82e (patch) | |
tree | 6a2d93ef3fb2d353bb7739e4b57e6541f51cdd71 /app/models/users | |
parent | a7253423e3403b8c08f8a161e5937e1488f5f407 (diff) |
Add latest changes from gitlab-org/gitlab@15-9-stable-eev15.9.0-rc42
Diffstat (limited to 'app/models/users')
-rw-r--r-- | app/models/users/saved_reply.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/models/users/saved_reply.rb b/app/models/users/saved_reply.rb index 7737d826b05..f0ae5445a46 100644 --- a/app/models/users/saved_reply.rb +++ b/app/models/users/saved_reply.rb @@ -9,11 +9,11 @@ module Users validates :user_id, :name, :content, presence: true validates :name, length: { maximum: 255 }, - uniqueness: { scope: [:user_id] }, - format: { - with: Gitlab::Regex.saved_reply_name_regex, - message: Gitlab::Regex.saved_reply_name_regex_message - } + uniqueness: { scope: [:user_id] } validates :content, length: { maximum: 10000 } + + def self.find_saved_reply(user_id:, id:) + ::Users::SavedReply.find_by(user_id: user_id, id: id) + end end end |