Disabling reset_design_doc to avoid conflict errors
This commit is contained in:
parent
ab6d833397
commit
0e282f0727
3 changed files with 7 additions and 5 deletions
|
@ -28,7 +28,7 @@ require 'couchrest/monkeypatches'
|
||||||
|
|
||||||
# = CouchDB, close to the metal
|
# = CouchDB, close to the metal
|
||||||
module CouchRest
|
module CouchRest
|
||||||
VERSION = '0.37.3' unless self.const_defined?("VERSION")
|
VERSION = '0.37.4' unless self.const_defined?("VERSION")
|
||||||
|
|
||||||
autoload :Server, 'couchrest/core/server'
|
autoload :Server, 'couchrest/core/server'
|
||||||
autoload :Database, 'couchrest/core/database'
|
autoload :Database, 'couchrest/core/database'
|
||||||
|
|
|
@ -60,7 +60,7 @@ module CouchRest
|
||||||
def refresh_design_doc(db = database)
|
def refresh_design_doc(db = database)
|
||||||
raise "Database missing for design document refresh" if db.nil?
|
raise "Database missing for design document refresh" if db.nil?
|
||||||
unless design_doc_fresh(db)
|
unless design_doc_fresh(db)
|
||||||
reset_design_doc
|
#reset_design_doc(db)
|
||||||
save_design_doc(db)
|
save_design_doc(db)
|
||||||
design_doc_fresh(db, true)
|
design_doc_fresh(db, true)
|
||||||
end
|
end
|
||||||
|
@ -91,8 +91,9 @@ module CouchRest
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def reset_design_doc
|
# Depricated (not very useful)
|
||||||
current = stored_design_doc
|
def reset_design_doc(db = database)
|
||||||
|
current = stored_design_doc(db)
|
||||||
design_doc['_id'] = design_doc_id
|
design_doc['_id'] = design_doc_id
|
||||||
if current.nil?
|
if current.nil?
|
||||||
design_doc.delete('_rev')
|
design_doc.delete('_rev')
|
||||||
|
@ -104,7 +105,7 @@ module CouchRest
|
||||||
# Writes out a design_doc to a given database, returning the
|
# Writes out a design_doc to a given database, returning the
|
||||||
# updated design doc
|
# updated design doc
|
||||||
def update_design_doc(design_doc, db, force = false)
|
def update_design_doc(design_doc, db, force = false)
|
||||||
saved = stored_design_doc
|
saved = stored_design_doc(db)
|
||||||
if saved
|
if saved
|
||||||
# Perform Hash comparison on views, only part that interests us
|
# Perform Hash comparison on views, only part that interests us
|
||||||
if force || design_doc['views'] != saved['views']
|
if force || design_doc['views'] != saved['views']
|
||||||
|
|
|
@ -55,6 +55,7 @@ describe "ExtendedDocument views" do
|
||||||
Article.view_by :title
|
Article.view_by :title
|
||||||
lambda{Article.by_title}.should_not raise_error
|
lambda{Article.by_title}.should_not raise_error
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "another model with a simple view" do
|
describe "another model with a simple view" do
|
||||||
|
|
Loading…
Add table
Reference in a new issue