From 5e0632c1d00024666a5b7561e2a5f09822873abb Mon Sep 17 00:00:00 2001 From: Matt Aimonetti Date: Thu, 28 May 2009 10:36:25 -0700 Subject: [PATCH] removed ObjectSpace usage --- lib/couchrest/more/extended_document.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/couchrest/more/extended_document.rb b/lib/couchrest/more/extended_document.rb index bcc2afd..f4497b9 100644 --- a/lib/couchrest/more/extended_document.rb +++ b/lib/couchrest/more/extended_document.rb @@ -15,7 +15,8 @@ module CouchRest include CouchRest::Mixins::ClassProxy def self.subclasses - ObjectSpace.enum_for(:each_object, class << self; self; end).to_a.delete_if{|k| k == self} + @subclasses ||= [] + # ObjectSpace.enum_for(:each_object, class << self; self; end).to_a.delete_if{|k| k == self} end def self.inherited(subklass) @@ -25,6 +26,7 @@ module CouchRest subklass.properties = self.properties.dup end EOS + subclasses << subklass end # Accessors