mirror of
https://github.com/ditkrg/validates_timeliness.git
synced 2026-01-25 07:16:41 +00:00
fix generated_methods bug where read instead of write method stored
existing spec failed unless run alone as attribute methods already primed. fixed spec to undef method and empty generated_methods set
This commit is contained in:
@@ -51,10 +51,11 @@ module ValidatesTimeliness
|
||||
if [:date, :time, :datetime].include?(column.type)
|
||||
time_zone_aware = create_time_zone_conversion_attribute?(name, column) rescue false
|
||||
|
||||
define_method("#{name}=") do |value|
|
||||
method_name = "#{name}="
|
||||
define_method(method_name) do |value|
|
||||
write_date_time_attribute(name, value, column.type, time_zone_aware)
|
||||
end
|
||||
timeliness_methods << name
|
||||
timeliness_methods << method_name
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user