mirror of
https://github.com/ditkrg/validates_timeliness.git
synced 2026-01-25 15:22:58 +00:00
Hook into undefine_attributes_methods to remove timeliness methods as well
This commit is contained in:
@@ -20,6 +20,11 @@ module ValidatesTimeliness
|
||||
:datetime
|
||||
end
|
||||
|
||||
def undefine_attribute_methods
|
||||
super
|
||||
undefine_timeliness_attribute_methods
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def define_timeliness_methods(before_type_cast=false)
|
||||
@@ -65,6 +70,12 @@ module ValidatesTimeliness
|
||||
def generated_timeliness_methods
|
||||
@generated_timeliness_methods ||= Module.new.tap { |m| include(m) }
|
||||
end
|
||||
|
||||
def undefine_timeliness_attribute_methods
|
||||
generated_timeliness_methods.module_eval do
|
||||
instance_methods.each { |m| undef_method(m) }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def _timeliness_raw_value_for(attr_name)
|
||||
|
||||
Reference in New Issue
Block a user