mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Rename the method to match what it is doing
This commit is contained in:
parent
72dc9ac8e3
commit
b24ed15baa
2 changed files with 3 additions and 3 deletions
|
@ -108,7 +108,7 @@ module ActiveModel
|
|||
end
|
||||
end
|
||||
|
||||
def read_attribute_for_validation(record, attr_name, value)
|
||||
def prepare_value_for_validation(value, record, attr_name)
|
||||
return value if record_attribute_changed_in_place?(record, attr_name)
|
||||
|
||||
came_from_user = :"#{attr_name}_came_from_user?"
|
||||
|
|
|
@ -149,7 +149,7 @@ module ActiveModel
|
|||
attributes.each do |attribute|
|
||||
value = record.read_attribute_for_validation(attribute)
|
||||
next if (value.nil? && options[:allow_nil]) || (value.blank? && options[:allow_blank])
|
||||
value = read_attribute_for_validation(record, attribute, value)
|
||||
value = prepare_value_for_validation(value, record, attribute)
|
||||
validate_each(record, attribute, value)
|
||||
end
|
||||
end
|
||||
|
@ -167,7 +167,7 @@ module ActiveModel
|
|||
end
|
||||
|
||||
private
|
||||
def read_attribute_for_validation(record, attr_name, value)
|
||||
def prepare_value_for_validation(value, record, attr_name)
|
||||
value
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue