summaryrefslogtreecommitdiffstats
path: root/app/helpers
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2009-02-20 18:55:56 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2009-02-20 18:55:56 +0000
commitb9e95e7a708501b62a2a886a544b97dbf41838b8 (patch)
tree1f1ba7832c02e1a40ddbaa361b433e1a9073e4c5 /app/helpers
parent33e7ae96adcb0282ee181560bb88c0765a8ee149 (diff)
downloadredmine-b9e95e7a708501b62a2a886a544b97dbf41838b8.tar.gz
redmine-b9e95e7a708501b62a2a886a544b97dbf41838b8.zip
Fixes "too few arguments" error on activerecord error translation (#2626).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2486 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/application_helper.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 2872c14a1..5b63ecd5a 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -573,11 +573,11 @@ module ApplicationHelper
full_messages = []
object.errors.each do |attr, msg|
next if msg.nil?
- msg = msg.first if msg.is_a? Array
+ msg = [msg] unless msg.is_a?(Array)
if attr == "base"
- full_messages << l(msg)
+ full_messages << l(*msg)
else
- full_messages << "&#171; " + (l_has_string?("field_" + attr) ? l("field_" + attr) : object.class.human_attribute_name(attr)) + " &#187; " + l(msg) unless attr == "custom_values"
+ full_messages << "&#171; " + (l_has_string?("field_" + attr) ? l("field_" + attr) : object.class.human_attribute_name(attr)) + " &#187; " + l(*msg) unless attr == "custom_values"
end
end
# retrieve custom values error messages
@@ -585,8 +585,8 @@ module ApplicationHelper
object.custom_values.each do |v|
v.errors.each do |attr, msg|
next if msg.nil?
- msg = msg.first if msg.is_a? Array
- full_messages << "&#171; " + v.custom_field.name + " &#187; " + l(msg)
+ msg = [msg] unless msg.is_a?(Array)
+ full_messages << "&#171; " + v.custom_field.name + " &#187; " + l(*msg)
end
end
end