mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Don't compute this string again
This commit is contained in:
parent
deb90d9485
commit
acbabd9626
1 changed files with 1 additions and 1 deletions
|
@ -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?
|
||||
|
|
Loading…
Reference in a new issue