lib/ruote/couch/storage.rb in ruote-couch-2.1.1 vs lib/ruote/couch/storage.rb in ruote-couch-2.1.4
- old
+ new
@@ -89,10 +89,15 @@
def get_many (type, key=nil, opts={})
@dbs[type].get_many(key, opts)
end
+ def ids (type)
+
+ @dbs[type].ids
+ end
+
def purge!
@dbs.values.each { |db| db.purge! }
end
@@ -106,13 +111,22 @@
@dbs.values.each { |db| db.shutdown }
end
# Mainly used by ruote's test/unit/ut_17_storage.rb
#
- def add_test_type (type)
+ def add_type (type)
@dbs[type] = Database.new(
@host, @port, type, "#{@prefix}ruote_#{type}", false)
+ end
+
+ # Nukes a db type and reputs it (losing all the documents that were in it).
+ #
+ def purge_type! (type)
+
+ if db = @dbs[type]
+ db.purge_docs!
+ end
end
protected
def put_configuration