diff options
Diffstat (limited to 'lib/gitlab/graphql/deprecations.rb')
-rw-r--r-- | lib/gitlab/graphql/deprecations.rb | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/gitlab/graphql/deprecations.rb b/lib/gitlab/graphql/deprecations.rb index 221b19bf8a3..61a49bd7473 100644 --- a/lib/gitlab/graphql/deprecations.rb +++ b/lib/gitlab/graphql/deprecations.rb @@ -11,6 +11,14 @@ module Gitlab attr_accessor :deprecation end + def initialize(*args, **kwargs, &block) + init_gitlab_deprecation(kwargs) + + super + + update_deprecation_description + end + def visible?(ctx) super && ctx[:remove_deprecated] == true ? deprecation.nil? : true end @@ -37,7 +45,12 @@ module Gitlab end kwargs[:deprecation_reason] = deprecation.deprecation_reason - kwargs[:description] = deprecation.edit_description(kwargs[:description]) + end + + def update_deprecation_description + return if deprecation.nil? + + description(deprecation.edit_description(description)) end end end |