lib/pickle/adapter.rb in kbaum-pickle-0.2.1.1 vs lib/pickle/adapter.rb in kbaum-pickle-0.2.1.2
- old
+ new
@@ -26,11 +26,15 @@
# remove abstract, framework, and non-table classes
@@model_classes ||= ::ActiveRecord::Base.send(:subclasses).reject do |klass|
klass.abstract_class? || !klass.table_exists? ||
(defined?(CGI::Session::ActiveRecordStore::Session) && klass == CGI::Session::ActiveRecordStore::Session) ||
(defined?(::ActiveRecord::SessionStore::Session) && klass == ::ActiveRecord::SessionStore::Session)
- end if defined?(::ActiveRecord)
+ end if class_exists?(::ActiveRecord)
@@model_classes ||= []
+ end
+
+ def self.class_exists?(klass)
+ defined?(klass)
end
# machinist adapter
class Machinist < Adapter
def self.factories
\ No newline at end of file