fixed class proxy design doc wreidness
This commit is contained in:
parent
3ee810010d
commit
4d4972f0de
|
@ -104,7 +104,7 @@ module CouchRest
|
|||
end
|
||||
|
||||
def refresh_design_doc
|
||||
@klass.refresh_design_doc
|
||||
@klass.refresh_design_doc_on(@database)
|
||||
end
|
||||
|
||||
def save_design_doc
|
||||
|
|
|
@ -48,6 +48,11 @@ module CouchRest
|
|||
save_design_doc
|
||||
end
|
||||
|
||||
def refresh_design_doc_on(db)
|
||||
reset_design_doc
|
||||
save_design_doc_on(db)
|
||||
end
|
||||
|
||||
# Save the design doc onto the default database, and update the
|
||||
# design_doc attribute
|
||||
def save_design_doc
|
||||
|
|
|
@ -95,11 +95,11 @@ module CouchRest
|
|||
|
||||
# Dispatches to any named view.
|
||||
def view(name, query={}, &block)
|
||||
unless design_doc_fresh
|
||||
refresh_design_doc
|
||||
db = query.delete(:database) || database
|
||||
unless design_doc_fresh
|
||||
refresh_design_doc_on(db)
|
||||
end
|
||||
query[:raw] = true if query[:reduce]
|
||||
db = query.delete(:database) || database
|
||||
raw = query.delete(:raw)
|
||||
fetch_view_with_docs(db, name, query, raw, &block)
|
||||
end
|
||||
|
|
|
@ -200,7 +200,7 @@ describe "ExtendedDocument views" do
|
|||
before(:all) do
|
||||
reset_test_db!
|
||||
# setup the class default doc to save the design doc
|
||||
Unattached.use_database DB
|
||||
Unattached.use_database nil # just to be sure it is really unattached
|
||||
@us = Unattached.on(DB)
|
||||
%w{aaa bbb ddd eee}.each do |title|
|
||||
u = @us.new(:title => title)
|
||||
|
|
Loading…
Reference in a new issue