diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-12-09 00:10:18 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-12-09 00:10:18 +0300 |
commit | 52af12cfecb5d7332b19f6d68218f0aff2cc525d (patch) | |
tree | 7b69d25c61f674c701c97614fdba0f42638a584b /app/models/snippet.rb | |
parent | 66b0c3d82e936f78e7f016bc0bf42d243d115efa (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/snippet.rb')
-rw-r--r-- | app/models/snippet.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/models/snippet.rb b/app/models/snippet.rb index d4e564f77e3..6a8123b3c08 100644 --- a/app/models/snippet.rb +++ b/app/models/snippet.rb @@ -197,6 +197,13 @@ class Snippet < ApplicationRecord Snippet.find_by(id: id, project: project) end + def find_by_project_title_trunc_created_at(project, title, created_at) + where(project: project, title: title) + .find_by( + "date_trunc('second', created_at at time zone :tz) at time zone :tz = :created_at", + tz: created_at.zone, created_at: created_at) + end + def max_file_limit MAX_FILE_COUNT end |