-
Notifications
You must be signed in to change notification settings - Fork 15
Aggregate does not accept properties on relationships in :fields #13
Comments
I've never tried it before, so YMMV, but if Problem.aggregate(:id.count, :fields => [User.id, User.email], :unique => true, ...) |
Thanks for the suggestion. I tried it a few different ways, all with differing errors.
|
Problem.aggregate(:id.count, :fields => [:user_id, "users.email"], :unique => true, :links => [:user])
ArgumentError: +field+ should be DataMapper::Query::Operator or Symbol or DataMapper::Property, but was String
'from /Users/tpitale/.rvm/gems/ruby-1.9.2-p180@docket/gems/dm-aggregates-1.1.0/lib/dm-aggregates/functions.rb:158:in
block in aggregate' from /Users/tpitale/.rvm/gems/ruby-1.9.2-p180@docket/gems/dm-aggregates-1.1.0/lib/dm-aggregates/functions.rb:158:in
map!'from /Users/tpitale/.rvm/gems/ruby-1.9.2-p180@docket/gems/dm-aggregates-1.1.0/lib/dm-aggregates/functions.rb:158:in
aggregate' from (irb):2 from /Users/tpitale/.rvm/gems/ruby-1.9.2-p180@docket/gems/railties-3.0.8/lib/rails/commands/console.rb:44:in
start'from /Users/tpitale/.rvm/gems/ruby-1.9.2-p180@docket/gems/railties-3.0.8/lib/rails/commands/console.rb:8:in
start' from /Users/tpitale/.rvm/gems/ruby-1.9.2-p180@docket/gems/railties-3.0.8/lib/rails/commands.rb:23:in
<top (required)>'from script/rails:6:in
require' from script/rails:6:in
The text was updated successfully, but these errors were encountered: