From b1fe78e0cb81d6d291b982927353c4fa39d8e269 Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Sun, 4 Nov 2012 11:41:05 -0200 Subject: Raise ArgumentError when no attribute is given to AMo::EachValidator ArgumentError is better suited than RuntimeError for this. --- activemodel/lib/active_model/validator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activemodel/lib') diff --git a/activemodel/lib/active_model/validator.rb b/activemodel/lib/active_model/validator.rb index c795dc9dcd..629b157fed 100644 --- a/activemodel/lib/active_model/validator.rb +++ b/activemodel/lib/active_model/validator.rb @@ -135,7 +135,7 @@ module ActiveModel # and instead be made available through the +attributes+ reader. def initialize(options) @attributes = Array(options.delete(:attributes)) - raise ":attributes cannot be blank" if @attributes.empty? + raise ArgumentError, ":attributes cannot be blank" if @attributes.empty? super check_validity! end -- cgit v1.2.3