summaryrefslogtreecommitdiff
path: root/app/serializers/suggestion_entity.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-08-20 18:42:06 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-08-20 18:42:06 +0000
commit6e4e1050d9dba2b7b2523fdd1768823ab85feef4 (patch)
tree78be5963ec075d80116a932011d695dd33910b4e /app/serializers/suggestion_entity.rb
parent1ce776de4ae122aba3f349c02c17cebeaa8ecf07 (diff)
downloadgitlab-ce-6e4e1050d9dba2b7b2523fdd1768823ab85feef4.tar.gz
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.rb18
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