datamapper/dm-core — Issue #167: InMemoryAdapter doesn't support aggregates
Author: carlhoerberg
Created: 2011-12-05 21:38:22+00:00
State: open

require 'dm-core'
require 'dm-aggregates'
DataMapper.setup(:default, :adapter => 'in_memory')
class Order
include DataMapper::Resource
property :id, Serial
has n, :order_lines
end
class OrderLine
include DataMapper::Resource
property :id, Serial
end
DataMapper.finalize
require 'minitest/autorun'
describe Order do
it 'can haz lines' do
o = Order.new
o.order_lines << OrderLine.new
o.save
assert_equal 1, o.order_lines.count
end
end

yields

NoMethodError: undefined method `aggregate' for #
/Users/carl/.rvm/gems/ruby-1.9.3-p0@global/gems/dm-aggregates-1.2.0/lib/dm-aggregates/repository.rb:8:in `aggregate'
/Users/carl/.rvm/gems/ruby-1.9.3-p0@global/gems/dm-aggregates-1.2.0/lib/dm-aggregates/functions.rb:185:in `aggregate'
/Users/carl/.rvm/gems/ruby-1.9.3-p0@global/gems/dm-aggregates-1.2.0/lib/dm-aggregates/functions.rb:40:in `count'
jada.rb:40:in `block (2 levels) in

'

am i doing something stupid again or isn't it implemented yet?