mirror of
https://github.com/ditkrg/validates_timeliness.git
synced 2026-01-22 22:06:45 +00:00
Can use simple Mongoid inclusion now that fixed Concern usage is released (a while ago)
This commit is contained in:
parent
fbc2867197
commit
9a99c47323
@ -36,18 +36,8 @@ module ValidatesTimeliness
|
|||||||
end
|
end
|
||||||
|
|
||||||
module Mongoid::Document
|
module Mongoid::Document
|
||||||
# Due to how Mongoid misuses ActiveSupport::Concern,
|
include ValidatesTimeliness::AttributeMethods
|
||||||
# the only way to override a core component method is
|
include ValidatesTimeliness::ORM::Mongoid
|
||||||
# using an append_features hook.
|
|
||||||
#
|
|
||||||
module TimelinessConcern
|
|
||||||
def append_features(base)
|
|
||||||
super
|
|
||||||
base.send :include, ValidatesTimeliness::AttributeMethods
|
|
||||||
base.send :include, ValidatesTimeliness::ORM::Mongoid
|
|
||||||
end
|
|
||||||
end
|
|
||||||
extend TimelinessConcern
|
|
||||||
|
|
||||||
def reload_with_timeliness
|
def reload_with_timeliness
|
||||||
_clear_timeliness_cache
|
_clear_timeliness_cache
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user