fixed the uuid count for the latest version of couchdb
also avoided CONSTANTS warnings, cleaned up the attachment specs, added missing fixtures
This commit is contained in:
parent
fe489f2d38
commit
80317f31a5
13 changed files with 106 additions and 35 deletions
|
@ -79,7 +79,7 @@ module CouchRest
|
|||
def next_uuid(count = @uuid_batch_count)
|
||||
@uuids ||= []
|
||||
if @uuids.empty?
|
||||
@uuids = CouchRest.post("#{@uri}/_uuids?count=#{count}")["uuids"]
|
||||
@uuids = CouchRest.get("#{@uri}/_uuids?count=#{count}")["uuids"]
|
||||
end
|
||||
@uuids.pop
|
||||
end
|
||||
|
|
|
@ -325,7 +325,7 @@ module CouchRest
|
|||
end
|
||||
|
||||
module ClassMethods
|
||||
CHAINS = {:before => :before, :around => :before, :after => :after}
|
||||
CHAINS = {:before => :before, :around => :before, :after => :after} unless self.const_defined?("CHAINS")
|
||||
|
||||
# Make the _run_save_callbacks method. The generated method takes
|
||||
# a block that it'll yield to. It'll call the before and around filters
|
||||
|
|
|
@ -14,7 +14,7 @@ module CouchRest
|
|||
|
||||
# reads the data from an attachment
|
||||
def read_attachment(attachment_name)
|
||||
Base64.decode64(database.fetch_attachment(self.id, attachment_name))
|
||||
Base64.decode64(database.fetch_attachment(self, attachment_name))
|
||||
end
|
||||
|
||||
# modifies a file attachment on the current doc
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
begin
|
||||
# still required for Time parsing and pluralization in the validation
|
||||
require 'extlib'
|
||||
rescue
|
||||
puts "CouchRest::ExtendedDocument still requires extlib (not for much longer). This is left out of the gemspec on purpose."
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue