aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model/validations/numericality.rb
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2013-05-01 18:31:33 -0700
committerRafael Mendonça França <rafaelmfranca@gmail.com>2013-05-01 18:31:33 -0700
commitb3a74a14a3d6efa22a07116c4cb26aadc479fb41 (patch)
treef5e7fe3933183c796cf82d2bada32417eb0b65e8 /activemodel/lib/active_model/validations/numericality.rb
parentdd1f36078eff18721eed76d236796c8d26d81e58 (diff)
parenteebb9ddf9ba559a510975c486fe59a4edc9da97d (diff)
downloadrails-b3a74a14a3d6efa22a07116c4cb26aadc479fb41.tar.gz
rails-b3a74a14a3d6efa22a07116c4cb26aadc479fb41.tar.bz2
rails-b3a74a14a3d6efa22a07116c4cb26aadc479fb41.zip
Merge pull request #10408 from patricksrobertson/convert_activemodel_to_new_hash_syntax
Convert ActiveModel to 1.9 hash syntax.
Diffstat (limited to 'activemodel/lib/active_model/validations/numericality.rb')
-rw-r--r--activemodel/lib/active_model/validations/numericality.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/activemodel/lib/active_model/validations/numericality.rb b/activemodel/lib/active_model/validations/numericality.rb
index 085532c35b..c6abe45f4a 100644
--- a/activemodel/lib/active_model/validations/numericality.rb
+++ b/activemodel/lib/active_model/validations/numericality.rb
@@ -2,9 +2,9 @@ module ActiveModel
module Validations
class NumericalityValidator < EachValidator # :nodoc:
- CHECKS = { :greater_than => :>, :greater_than_or_equal_to => :>=,
- :equal_to => :==, :less_than => :<, :less_than_or_equal_to => :<=,
- :odd => :odd?, :even => :even?, :other_than => :!= }.freeze
+ CHECKS = { greater_than: :>, greater_than_or_equal_to: :>=,
+ equal_to: :==, less_than: :<, less_than_or_equal_to: :<=,
+ odd: :odd?, even: :even?, other_than: :!= }.freeze
RESERVED_OPTIONS = CHECKS.keys + [:only_integer]
@@ -47,7 +47,7 @@ module ActiveModel
option_value = record.send(option_value) if option_value.is_a?(Symbol)
unless value.send(CHECKS[option], option_value)
- record.errors.add(attr_name, option, filtered_options(value).merge(:count => option_value))
+ record.errors.add(attr_name, option, filtered_options(value).merge(count: option_value))
end
end
end
@@ -73,7 +73,7 @@ module ActiveModel
end
def filtered_options(value)
- options.except(*RESERVED_OPTIONS).merge!(:value => value)
+ options.except(*RESERVED_OPTIONS).merge!(value: value)
end
end