diff options
author | Akira Matsuda <ronnie@dio.jp> | 2013-01-07 07:36:11 +0900 |
---|---|---|
committer | Akira Matsuda <ronnie@dio.jp> | 2013-01-07 07:37:23 +0900 |
commit | 3c21237c37fed9d726bcf2816bf1adc4635f4956 (patch) | |
tree | eafdae1d97c622b5f867acb1eda742f6893cc1dc /activemodel/lib/active_model/validations/numericality.rb | |
parent | c8e632bd9fe246aab16496e87184ace20ab3ce27 (diff) | |
download | rails-3c21237c37fed9d726bcf2816bf1adc4635f4956.tar.gz rails-3c21237c37fed9d726bcf2816bf1adc4635f4956.tar.bz2 rails-3c21237c37fed9d726bcf2816bf1adc4635f4956.zip |
Reduce number of Strings a bit
Diffstat (limited to 'activemodel/lib/active_model/validations/numericality.rb')
-rw-r--r-- | activemodel/lib/active_model/validations/numericality.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activemodel/lib/active_model/validations/numericality.rb b/activemodel/lib/active_model/validations/numericality.rb index 744c196d30..085532c35b 100644 --- a/activemodel/lib/active_model/validations/numericality.rb +++ b/activemodel/lib/active_model/validations/numericality.rb @@ -17,9 +17,9 @@ module ActiveModel end def validate_each(record, attr_name, value) - before_type_cast = "#{attr_name}_before_type_cast" + before_type_cast = :"#{attr_name}_before_type_cast" - raw_value = record.send(before_type_cast) if record.respond_to?(before_type_cast.to_sym) + raw_value = record.send(before_type_cast) if record.respond_to?(before_type_cast) raw_value ||= value return if options[:allow_nil] && raw_value.nil? |