summaryrefslogtreecommitdiff
path: root/app/models/snippet.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-06 18:08:08 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-06 18:08:08 +0000
commit83731155d997ae24c7e0cd5ffa6f0dba41bec6dc (patch)
tree31f785012137fda4ac9a470f4f07c961b42d0299 /app/models/snippet.rb
parent57a37ce99f297cddae12cb4d982b6d572f932bb4 (diff)
downloadgitlab-ce-83731155d997ae24c7e0cd5ffa6f0dba41bec6dc.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/snippet.rb')
-rw-r--r--app/models/snippet.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/snippet.rb b/app/models/snippet.rb
index 27e1778e9b6..5c2e03e4b9c 100644
--- a/app/models/snippet.rb
+++ b/app/models/snippet.rb
@@ -302,6 +302,10 @@ class Snippet < ApplicationRecord
field != :content || MarkupHelper.gitlab_markdown?(file_name)
end
+ def hexdigest
+ Digest::SHA256.hexdigest("#{title}#{description}#{created_at}#{updated_at}")
+ end
+
class << self
# Searches for snippets with a matching title or file name.
#