diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-03 12:07:54 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-03 12:07:54 +0300 |
commit | 87ef501eacd66d7166183d20d84e33de022f7002 (patch) | |
tree | fa4e0f41e00a4b6aeb035530be4b5473f51b7a3d /app/models/description_version.rb | |
parent | f321e51f46bcb628c3e96a44b5ebf3bb1c4033ab (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/description_version.rb')
-rw-r--r-- | app/models/description_version.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/models/description_version.rb b/app/models/description_version.rb index 05362a2f90b..f69564f4893 100644 --- a/app/models/description_version.rb +++ b/app/models/description_version.rb @@ -19,7 +19,13 @@ class DescriptionVersion < ApplicationRecord def exactly_one_issuable issuable_count = self.class.issuable_attrs.count { |attr| self["#{attr}_id"] } - errors.add(:base, "Exactly one of #{self.class.issuable_attrs.join(', ')} is required") if issuable_count != 1 + if issuable_count != 1 + errors.add( + :base, + _("Exactly one of %{attributes} is required") % + { attributes: self.class.issuable_attrs.join(', ') } + ) + end end end |