summaryrefslogtreecommitdiff
path: root/app/controllers/snippets_controller.rb
diff options
context:
space:
mode:
authorZ.J. van de Weg <zegerjan@gitlab.com>2016-06-03 11:44:04 +0200
committerFatih Acet <acetfatih@gmail.com>2016-09-19 19:47:43 +0300
commit25004cbc32432d989a05532925c5c4c591cca1b5 (patch)
tree24b83bb5993f196c7fcfd0e0c30d14b4cc26dd31 /app/controllers/snippets_controller.rb
parentb94de5fd555213ae28030c33c27440228f8efb65 (diff)
downloadgitlab-ce-25004cbc32432d989a05532925c5c4c591cca1b5.tar.gz
Snippets get award emoji! :thumbsup:
Diffstat (limited to 'app/controllers/snippets_controller.rb')
-rw-r--r--app/controllers/snippets_controller.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/controllers/snippets_controller.rb b/app/controllers/snippets_controller.rb
index 2a17c1f34db..d198782138a 100644
--- a/app/controllers/snippets_controller.rb
+++ b/app/controllers/snippets_controller.rb
@@ -1,4 +1,6 @@
class SnippetsController < ApplicationController
+ include ToggleAwardEmoji
+
before_action :snippet, only: [:show, :edit, :destroy, :update, :raw]
# Allow read snippet
@@ -85,6 +87,7 @@ class SnippetsController < ApplicationController
PersonalSnippet.find(params[:id])
end
end
+ alias_method :awardable, :snippet
def authorize_read_snippet!
authenticate_user! unless can?(current_user, :read_personal_snippet, @snippet)