57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
# File 'lib/promiscuous/publisher/mongoid/defer.rb', line 57
def setup_class_binding
super
klass.class_eval do
cattr_accessor :publisher_defer_hooked
return if self.publisher_defer_hooked
self.publisher_defer_hooked = true
field :_psp, :type => Boolean
field :_psv, :type => Integer
index({:_psp => 1}, :background => true, :sparse => true)
Promiscuous::Publisher::Mongoid::Defer.hook_mongoid
Promiscuous::Publisher::Mongoid::Defer.klasses[self.to_s] = self
Promiscuous::Publisher::Mongoid::Defer.collections[collection.name] = true
end if klass
end
|