mirror of
https://github.com/ditkrg/validates_timeliness.git
synced 2026-01-24 14:56:43 +00:00
rename named local var
This commit is contained in:
parent
a56cf674b2
commit
4ac4281c8b
@ -25,14 +25,14 @@ module ValidatesTimeliness
|
|||||||
def write_date_time_attribute(attr_name, value, type, time_zone_aware)
|
def write_date_time_attribute(attr_name, value, type, time_zone_aware)
|
||||||
@attributes_cache["_#{attr_name}_before_type_cast"] = value
|
@attributes_cache["_#{attr_name}_before_type_cast"] = value
|
||||||
|
|
||||||
new = ValidatesTimeliness::Parser.parse(value, type)
|
value = ValidatesTimeliness::Parser.parse(value, type)
|
||||||
|
|
||||||
if new && type != :date
|
if value && type != :date
|
||||||
new = new.to_time
|
value = value.to_time
|
||||||
new = new.in_time_zone if time_zone_aware
|
value = value.in_time_zone if time_zone_aware
|
||||||
end
|
end
|
||||||
|
|
||||||
write_attribute(attr_name.to_sym, new)
|
write_attribute(attr_name.to_sym, value)
|
||||||
end
|
end
|
||||||
|
|
||||||
def read_attribute_before_type_cast_with_timeliness(attr_name)
|
def read_attribute_before_type_cast_with_timeliness(attr_name)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user