From 4796be33a464a4587d0e22dfef113aca597c91c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Sun, 3 Jan 2010 16:58:33 +0100 Subject: Add missing tests to Validators. --- activemodel/lib/active_model/validator.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'activemodel/lib') diff --git a/activemodel/lib/active_model/validator.rb b/activemodel/lib/active_model/validator.rb index 8c9f9c7fb3..01695cb73a 100644 --- a/activemodel/lib/active_model/validator.rb +++ b/activemodel/lib/active_model/validator.rb @@ -72,7 +72,8 @@ module ActiveModel #:nodoc: attr_reader :attributes def initialize(options) - @attributes = options.delete(:attributes) + @attributes = Array(options.delete(:attributes)) + raise ":attributes cannot be blank" if @attributes.empty? super check_validity! end -- cgit v1.2.3