Permalink
Browse files

Don't compute this string again

  • Loading branch information...
1 parent deb90d9 commit acbabd96268237826e1ab094273a1d7d53b4e579 @spastorino spastorino committed Dec 2, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 activemodel/lib/active_model/validations/numericality.rb
@@ -24,7 +24,7 @@ def check_validity!
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?

0 comments on commit acbabd9

Please sign in to comment.