Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/helpers/users_helpers.rb')
-rw-r--r--lib/api/helpers/users_helpers.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/api/helpers/users_helpers.rb b/lib/api/helpers/users_helpers.rb
index e80b89488a2..f97071d9a97 100644
--- a/lib/api/helpers/users_helpers.rb
+++ b/lib/api/helpers/users_helpers.rb
@@ -12,10 +12,14 @@ module API
params :optional_index_params_ee do
end
- def model_error_messages(model)
- super.tap do |error_messages|
+ def model_errors(model)
+ super.tap do |errors|
# Remapping errors from nested associations.
- error_messages[:bio] = error_messages.delete(:"user_detail.bio") if error_messages.has_key?(:"user_detail.bio")
+ next unless errors.has_key?(:"user_detail.bio")
+
+ errors.delete(:"user_detail.bio").each do |message|
+ errors.add(:bio, message)
+ end
end
end