From 83a34b02a74835566bc524a2b08a53d9eeb855d2 Mon Sep 17 00:00:00 2001 From: Aaron Date: Thu, 8 Sep 2011 16:51:28 -0700 Subject: [PATCH] Make on method actually return empty array in case of no errors, instead of nil. Method now matches documentation. --- lib/dm-validations/validation_errors.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dm-validations/validation_errors.rb b/lib/dm-validations/validation_errors.rb index 603b274f..4f5f53cc 100644 --- a/lib/dm-validations/validation_errors.rb +++ b/lib/dm-validations/validation_errors.rb @@ -99,7 +99,7 @@ def full_messages # on given field def on(field_name) errors_for_field = errors[field_name] - DataMapper::Ext.blank?(errors_for_field) ? nil : errors_for_field.uniq + DataMapper::Ext.blank?(errors_for_field) ? [] : errors_for_field.uniq end def each