couchrest_model/lib/couchrest/support/couchrest.rb
Sam Lown b0d2258bd3 Improving handling of mime types, instanciation of documents from the
database, and more dependencies on active_support.
2010-05-12 23:43:17 +02:00

20 lines
425 B
Ruby

module CouchRest
class Database
alias :delete_old! :delete!
def delete!
clear_extended_doc_fresh_cache
delete_old!
end
# If the database is deleted, ensure that the design docs will be refreshed.
def clear_extended_doc_fresh_cache
::CouchRest::ExtendedDocument.subclasses.each{|klass| klass.req_design_doc_refresh if klass.respond_to?(:req_design_doc_refresh)}
end
end
end