diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
commit | 6e4e1050d9dba2b7b2523fdd1768823ab85feef4 (patch) | |
tree | 78be5963ec075d80116a932011d695dd33910b4e /app/serializers/suggestion_entity.rb | |
parent | 1ce776de4ae122aba3f349c02c17cebeaa8ecf07 (diff) |
Add latest changes from gitlab-org/gitlab@13-3-stable-ee
Diffstat (limited to 'app/serializers/suggestion_entity.rb')
-rw-r--r-- | app/serializers/suggestion_entity.rb | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/app/serializers/suggestion_entity.rb b/app/serializers/suggestion_entity.rb index c9fcbe14f2e..c224d0b4390 100644 --- a/app/serializers/suggestion_entity.rb +++ b/app/serializers/suggestion_entity.rb @@ -16,24 +16,8 @@ class SuggestionEntity < API::Entities::Suggestion expose :inapplicable_reason do |suggestion| next _("You don't have write access to the source branch.") unless can_apply?(suggestion) - next if suggestion.appliable? - case suggestion.inapplicable_reason - when :merge_request_merged - _("This merge request was merged. To apply this suggestion, edit this file directly.") - when :merge_request_closed - _("This merge request is closed. To apply this suggestion, edit this file directly.") - when :source_branch_deleted - _("Can't apply as the source branch was deleted.") - when :outdated - phrase = suggestion.single_line? ? 'this line was' : 'these lines were' - - _("Can't apply as %{phrase} changed in a more recent version.") % { phrase: phrase } - when :same_content - _("This suggestion already matches its content.") - else - _("Can't apply this suggestion.") - end + suggestion.inapplicable_reason end private |