diff options
author | José Valim <jose.valim@gmail.com> | 2010-01-11 23:37:48 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-01-11 23:38:35 +0100 |
commit | b078f7fd3910b0b174bc951cc8c0d27536b09c16 (patch) | |
tree | c12d709d1427e7acd0551b8d58fd1d1b88899a24 /activemodel/lib/active_model | |
parent | cccb9988002f7b44133c089654b417ae9808b65f (diff) | |
download | rails-b078f7fd3910b0b174bc951cc8c0d27536b09c16.tar.gz rails-b078f7fd3910b0b174bc951cc8c0d27536b09c16.tar.bz2 rails-b078f7fd3910b0b174bc951cc8c0d27536b09c16.zip |
Fix typos and add tests to ensure they will be caught the next time.
Diffstat (limited to 'activemodel/lib/active_model')
-rw-r--r-- | activemodel/lib/active_model/validations/numericality.rb | 4 | ||||
-rw-r--r-- | activemodel/lib/active_model/validations/validates.rb | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/activemodel/lib/active_model/validations/numericality.rb b/activemodel/lib/active_model/validations/numericality.rb index adf34bf454..c6d84c5312 100644 --- a/activemodel/lib/active_model/validations/numericality.rb +++ b/activemodel/lib/active_model/validations/numericality.rb @@ -10,8 +10,8 @@ module ActiveModel end def check_validity! - keys = CHECKS.keys - [:odd, :event] - options.slice(*keys) do |option, value| + keys = CHECKS.keys - [:odd, :even] + options.slice(*keys).each do |option, value| next if value.is_a?(Numeric) || value.is_a?(Proc) || value.is_a?(Symbol) raise ArgumentError, ":#{option} must be a number, a symbol or a proc" end diff --git a/activemodel/lib/active_model/validations/validates.rb b/activemodel/lib/active_model/validations/validates.rb index 80924f50d6..4c82a993ae 100644 --- a/activemodel/lib/active_model/validations/validates.rb +++ b/activemodel/lib/active_model/validations/validates.rb @@ -54,7 +54,7 @@ module ActiveModel # The validators hash can also handle regular expressions, ranges and arrays: # # validates :email, :format => /@/ - # validates :gender, :inclusion => %w(mail female) + # validates :gender, :inclusion => %w(male female) # validates :password, :length => 6..20 # # Finally, the options :if, :unless, :on, :allow_blank and :allow_nil can be given |