diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2010-12-02 15:43:12 -0200 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2010-12-02 15:43:12 -0200 |
commit | acbabd96268237826e1ab094273a1d7d53b4e579 (patch) | |
tree | ea44280055a30e633f89a1530209d85bd257096d | |
parent | deb90d9485516832d86afcf6e6810e1c98c836ab (diff) | |
download | rails-acbabd96268237826e1ab094273a1d7d53b4e579.tar.gz rails-acbabd96268237826e1ab094273a1d7d53b4e579.tar.bz2 rails-acbabd96268237826e1ab094273a1d7d53b4e579.zip |
Don't compute this string again
-rw-r--r-- | activemodel/lib/active_model/validations/numericality.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activemodel/lib/active_model/validations/numericality.rb b/activemodel/lib/active_model/validations/numericality.rb index b6aff7aa6b..95fe20de75 100644 --- a/activemodel/lib/active_model/validations/numericality.rb +++ b/activemodel/lib/active_model/validations/numericality.rb @@ -24,7 +24,7 @@ module ActiveModel def validate_each(record, attr_name, value) before_type_cast = "#{attr_name}_before_type_cast" - raw_value = record.send("#{attr_name}_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.to_sym) raw_value ||= value return if options[:allow_nil] && raw_value.nil? |