提交 acbabd96 编写于 作者: S Santiago Pastorino

Don't compute this string again

上级 deb90d94
......@@ -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?
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册