Skip to content

Commit

Permalink
track mongoid models
Browse files Browse the repository at this point in the history
Signed-off-by: David A. Cuadrado <krawek@gmail.com>
  • Loading branch information
dcu committed Oct 5, 2011
1 parent 9b9a134 commit 5052d72
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion lib/mongoid_ext/patches.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,17 @@ def nolock_eval(code, *args)
doc['retval']
end
end
end
end

module Mongoid
module Document
def self.included(base)
models << base.to_s
super
end

def self.models
@models ||= []
end
end
end

0 comments on commit 5052d72

Please sign in to comment.