Assuming you have this setup
class User < ActiveRecord::Base
acts_as_voter
acts_as_commentator
has_many :comments
end
class Comment < ActiveRecord::Base
acts_as_votable
belongs_to :user
end
And the following after installing commentator
and acts_as_votable
gems
rails generate acts_as_votable:migration
rake commontator:install
rake db:migrate
You should be able to get the number of votes like this
@user.comments.collect{|c| c.votes.size}.inject(:+)