diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-07-22 00:10:17 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-07-22 00:10:17 +0300 |
commit | 6b1cf9e9ce2308c3867a241cbbcade8099540604 (patch) | |
tree | 69bdf96873da208dd83b95f209257069b73b7b7d /lib/gitlab/graphql | |
parent | 5d41ea8c8e83ff6054ba4303ec8dc9bc33556602 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/graphql')
-rw-r--r-- | lib/gitlab/graphql/deprecation.rb | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/gitlab/graphql/deprecation.rb b/lib/gitlab/graphql/deprecation.rb index d30751fe46e..7ba339d4191 100644 --- a/lib/gitlab/graphql/deprecation.rb +++ b/lib/gitlab/graphql/deprecation.rb @@ -21,8 +21,18 @@ module Gitlab validate :milestone_is_string validate :reason_known_or_string - def self.parse(options) - new(**options) if options + def self.parse(alpha: nil, deprecated: nil) + options = alpha || deprecated + return unless options + + if alpha + raise ArgumentError, '`alpha` and `deprecated` arguments cannot be passed at the same time' \ + if deprecated + + options[:reason] = :alpha + end + + new(**options) end def initialize(reason: nil, milestone: nil, replacement: nil) |