From 4b9b2a43d02fc5154f780ade7fe76c02420fff15 Mon Sep 17 00:00:00 2001 From: Luke Duncalfe Date: Fri, 21 Jun 2019 16:45:27 +1200 Subject: GraphQL mutations for add, remove and toggle emoji Adding new `AddAwardEmoji`, `RemoveAwardEmoji` and `ToggleAwardEmoji` GraphQL mutations. Adding new `#authorized_find_with_pre_checks!` and (unused, but for completeness `#authorized_find_with_post_checks!`) authorization methods. These allow us to perform an authorized find, and run our own additional checks before or after the authorization runs. https://gitlab.com/gitlab-org/gitlab-ce/issues/62826 --- app/models/snippet.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app/models/snippet.rb') diff --git a/app/models/snippet.rb b/app/models/snippet.rb index f4fdac2558c..00931457344 100644 --- a/app/models/snippet.rb +++ b/app/models/snippet.rb @@ -194,6 +194,10 @@ class Snippet < ApplicationRecord 'snippet' end + def to_ability_name + model_name.singular + end + class << self # Searches for snippets with a matching title or file name. # -- cgit v1.2.1