mirror of
https://github.com/ditkrg/validates_timeliness.git
synced 2026-01-23 06:16:44 +00:00
Merge pull request #128 from monkbroc/patch-1
Generate attribute methods once instead of on each object creation
This commit is contained in:
commit
4d48c3578b
@ -23,7 +23,9 @@ module ValidatesTimeliness
|
|||||||
|
|
||||||
def define_attribute_methods
|
def define_attribute_methods
|
||||||
super.tap do |attribute_methods_generated|
|
super.tap do |attribute_methods_generated|
|
||||||
|
return false if @timeliness_methods_generated
|
||||||
define_timeliness_methods true
|
define_timeliness_methods true
|
||||||
|
@timeliness_methods_generated = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user