Skip to content

Commit

Permalink
Use dm-aggregates
Browse files Browse the repository at this point in the history
  • Loading branch information
jcrosby committed Feb 10, 2009
1 parent 5ec85eb commit 245f9df
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions cloudkit.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ Gem::Specification.new do |s|
s.add_dependency 'rack-config', '>= 0.9'
s.add_dependency 'uuid', '= 2.0.1'
s.add_dependency 'dm-core', '~> 0.9.10'
s.add_dependency 'dm-aggregates', '~> 0.9.10'
s.add_dependency 'dm-validations', '~> 0.9.10'
s.add_dependency 'oauth', '~> 0.3'
s.add_dependency 'ruby-openid', '= 2.1.2'
Expand Down
1 change: 1 addition & 0 deletions lib/cloudkit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
require 'md5'
require 'openid'
require 'dm-core'
require 'dm-aggregates'
require 'dm-validations'
require 'time'
require 'uuid'
Expand Down
4 changes: 2 additions & 2 deletions lib/cloudkit/store.rb
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ def update_resource(uri, options)

# Bundle a collection of results as a list of URIs for the response.
def bundle_collection_result(uri, options, result)
total = result.size
total = result.count
offset = options[:offset].try(:to_i) || 0
max = options[:limit] ? offset + options[:limit].to_i : total
list = result.to_a[offset...max].map{|r| r.uri}
Expand All @@ -439,7 +439,7 @@ def bundle_collection_result(uri, options, result)
# metadata (last_modified, uri, etag) that would have accompanied a response
# to their singular request.
def bundle_resolved_collection_result(uri, options, result)
total = result.size
total = result.count
offset = options[:offset].try(:to_i) || 0
max = options[:limit] ? offset + options[:limit].to_i : total
list = result.to_a[offset...max]
Expand Down

0 comments on commit 245f9df

Please sign in to comment.