2010-05-10 21:19:24 +02:00
|
|
|
|
|
|
|
module CouchRest
|
|
|
|
|
|
|
|
class Database
|
|
|
|
|
2010-06-21 15:10:42 +02:00
|
|
|
alias :delete_orig! :delete!
|
2010-05-10 21:19:24 +02:00
|
|
|
def delete!
|
2010-06-20 22:01:11 +02:00
|
|
|
clear_model_fresh_cache
|
2010-06-21 15:10:42 +02:00
|
|
|
delete_orig!
|
2010-05-10 21:19:24 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
# If the database is deleted, ensure that the design docs will be refreshed.
|
2010-06-20 22:01:11 +02:00
|
|
|
def clear_model_fresh_cache
|
|
|
|
::CouchRest::Model::Base.subclasses.each{|klass| klass.req_design_doc_refresh if klass.respond_to?(:req_design_doc_refresh)}
|
2010-05-10 21:19:24 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|