mirror of
https://github.com/ditkrg/validates_timeliness.git
synced 2026-01-23 06:16:44 +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
|
||||
|
||||
module Mongoid::Document
|
||||
# Due to how Mongoid misuses ActiveSupport::Concern,
|
||||
# the only way to override a core component method is
|
||||
# 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
|
||||
include ValidatesTimeliness::AttributeMethods
|
||||
include ValidatesTimeliness::ORM::Mongoid
|
||||
|
||||
def reload_with_timeliness
|
||||
_clear_timeliness_cache
|
||||
|
||||
Loading…
Reference in New Issue
Block a user