From 2c5a2e7f2e45207a204cf97a99445b2c2823e5e6 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 13 Dec 2004 19:25:33 +0000 Subject: Extended no inclusion of messages if theyre nil to base git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@144 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/lib/active_record/validations.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/validations.rb') diff --git a/activerecord/lib/active_record/validations.rb b/activerecord/lib/active_record/validations.rb index 2ae4edbb2d..0ae764936d 100755 --- a/activerecord/lib/active_record/validations.rb +++ b/activerecord/lib/active_record/validations.rb @@ -350,10 +350,12 @@ module ActiveRecord @errors.each_key do |attr| @errors[attr].each do |msg| + next if msg.nil? + if attr == "base" full_messages << msg else - full_messages << @base.class.human_attribute_name(attr) + " " + msg unless msg.nil? + full_messages << @base.class.human_attribute_name(attr) + " " + msg end end end -- cgit v1.2.3