lib/couchrest/mixins/views.rb in couchrest-0.30 vs lib/couchrest/mixins/views.rb in couchrest-0.31
- old
+ new
@@ -70,11 +70,11 @@
# that model won't be available until generation is complete. This can
# take some time with large databases. Strategies are in the works.
#
# To understand the capabilities of this view system more completely,
# it is recommended that you read the RSpec file at
- # <tt>spec/core/model_spec.rb</tt>.
+ # <tt>spec/couchrest/more/extended_doc_spec.rb</tt>.
def view_by(*keys)
opts = keys.pop if keys.last.is_a?(Hash)
opts ||= {}
ducktype = opts.delete(:ducktype)
@@ -122,18 +122,10 @@
# Deletes the current design doc for the current class.
# Running it to early could mean that live code has to regenerate
# potentially large indexes.
def cleanup_design_docs!(db = database)
save_design_doc_on(db)
- # db.refresh_design_doc
- # db.save_design_doc
- # design_doc = model_design_doc(db)
- # if design_doc
- # db.delete_doc(design_doc)
- # else
- # false
- # end
end
private
def fetch_view_with_docs(db, name, opts, raw=false, &block)
@@ -160,10 +152,10 @@
raise "A view needs a database to operate on (specify :database option, or use_database in the #{self.class} class)" unless db
retryable = true
begin
design_doc.view_on(db, view_name, opts, &block)
# the design doc may not have been saved yet on this database
- rescue RestClient::ResourceNotFound => e
+ rescue HttpAbstraction::ResourceNotFound => e
if retryable
save_design_doc_on(db)
retryable = false
retry
else
\ No newline at end of file