I'm using the Public Activity gem to track user's comments. I would like to get fetch all unique user comments in a query. I tried doing the following:
PublicActivity::Activity.where(:trackable_type=>"Comment").where(:owner_id => user.id).all.select(:trackable_id).distinct
But I'm getting the error:
ArgumentError: wrong number of arguments(1 for 0)
from (irb):14:in `select'
from (irb):14
from /Users/ttseng/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.15/lib/rails/commands/console.rb:47:in `start'
from /Users/ttseng/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.15/lib/rails/commands/console.rb:8:in `start'
from /Users/ttseng/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.15/lib/rails/commands.rb:41:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Does anyone know how to extract of a user's unique activities based on trackable_id?
For reference, this is what my query results look like before I attempt to fetch the unique records: