summaryrefslogtreecommitdiffstats
path: root/app/helpers/application_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers/application_helper.rb')
-rw-r--r--app/helpers/application_helper.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 72d9d8efd..43f32fbc7 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -1503,7 +1503,7 @@ module ApplicationHelper
# Render the error messages for the given objects
def error_messages_for(*objects)
- objects = objects.map {|o| o.is_a?(String) ? instance_variable_get("@#{o}") : o}.compact
+ objects = objects.filter_map {|o| o.is_a?(String) ? instance_variable_get("@#{o}") : o}
errors = objects.map {|o| o.errors.full_messages}.flatten
render_error_messages(errors)
end