Refactoring design doc manipulation for a much simpler and more reliable approach

This commit is contained in:
Sam Lown 2011-04-17 02:46:33 +02:00
parent 2eed3581af
commit 5805f6e27b
19 changed files with 285 additions and 195 deletions

View file

@ -1,15 +0,0 @@
CouchRest::Database.class_eval do
alias :delete_orig! :delete!
def delete!
clear_model_fresh_cache
delete_orig!
end
# If the database is deleted, ensure that the design docs will be refreshed.
def clear_model_fresh_cache
::CouchRest::Model::Base.subclasses.each{|klass| klass.req_design_doc_refresh if klass.respond_to?(:req_design_doc_refresh)}
end
end