Browse files

Disabling reset_design_doc to avoid conflict errors

  • Loading branch information...
1 parent ab6d833 commit 0e282f0727f62403d96598cebbf6705a91ec21dd Sam Lown committed Apr 14, 2010
Showing with 7 additions and 5 deletions.
  1. +1 −1 lib/couchrest.rb
  2. +5 −4 lib/couchrest/mixins/design_doc.rb
  3. +1 −0 spec/couchrest/more/extended_doc_view_spec.rb
View
2 lib/couchrest.rb
@@ -28,7 +28,7 @@
# = CouchDB, close to the metal
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 :Database, 'couchrest/core/database'
View
9 lib/couchrest/mixins/design_doc.rb
@@ -60,7 +60,7 @@ def stored_design_doc(db = database)
def refresh_design_doc(db = database)
raise "Database missing for design document refresh" if db.nil?
unless design_doc_fresh(db)
- reset_design_doc
+ #reset_design_doc(db)
save_design_doc(db)
design_doc_fresh(db, true)
end
@@ -91,8 +91,9 @@ def design_doc_fresh(db, fresh = nil)
end
end
- def reset_design_doc
- current = stored_design_doc
+ # Depricated (not very useful)
+ def reset_design_doc(db = database)
+ current = stored_design_doc(db)
design_doc['_id'] = design_doc_id
if current.nil?
design_doc.delete('_rev')
@@ -104,7 +105,7 @@ def reset_design_doc
# Writes out a design_doc to a given database, returning the
# updated design doc
def update_design_doc(design_doc, db, force = false)
- saved = stored_design_doc
+ saved = stored_design_doc(db)
if saved
# Perform Hash comparison on views, only part that interests us
if force || design_doc['views'] != saved['views']
View
1 spec/couchrest/more/extended_doc_view_spec.rb
@@ -55,6 +55,7 @@ class Unattached < CouchRest::ExtendedDocument
Article.view_by :title
lambda{Article.by_title}.should_not raise_error
end
+
end
describe "another model with a simple view" do

0 comments on commit 0e282f0

Please sign in to comment.