diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-11-04 11:41:05 -0200 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-11-04 11:41:05 -0200 |
commit | b1fe78e0cb81d6d291b982927353c4fa39d8e269 (patch) | |
tree | fc4d897bb560b26a5ecbe71bfa280fc52d9aec82 /activemodel/lib | |
parent | d9f20c575a29e8ec8eb549aae63b7c304dc27489 (diff) | |
download | rails-b1fe78e0cb81d6d291b982927353c4fa39d8e269.tar.gz rails-b1fe78e0cb81d6d291b982927353c4fa39d8e269.tar.bz2 rails-b1fe78e0cb81d6d291b982927353c4fa39d8e269.zip |
Raise ArgumentError when no attribute is given to AMo::EachValidator
ArgumentError is better suited than RuntimeError for this.
Diffstat (limited to 'activemodel/lib')
-rw-r--r-- | activemodel/lib/active_model/validator.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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 |