diff options
author | José Valim <jose.valim@gmail.com> | 2010-01-03 16:58:33 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-01-03 17:14:50 +0100 |
commit | 4796be33a464a4587d0e22dfef113aca597c91c4 (patch) | |
tree | d6e30ad9c8f9721d48d2e0c9483efc7baffac621 /activemodel/lib | |
parent | 271e7c803f116b77f0df48115036421242eb9b32 (diff) | |
download | rails-4796be33a464a4587d0e22dfef113aca597c91c4.tar.gz rails-4796be33a464a4587d0e22dfef113aca597c91c4.tar.bz2 rails-4796be33a464a4587d0e22dfef113aca597c91c4.zip |
Add missing tests to Validators.
Diffstat (limited to 'activemodel/lib')
-rw-r--r-- | activemodel/lib/active_model/validator.rb | 3 |
1 files changed, 2 insertions, 1 deletions
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 |