Thank you to anyone who has already donated - your generous donations helped make three months of treatment possible.
My brother Nate continues to fight stage IV Hodgkin's lymphoma. He's just 31, with a wife and baby girl. They have no active income (since he's been unable to return to work), no insurance, and cannot afford the treatment he needs. Nate and his family need your help. Please consider a donation, every dollar helps. Thanks.
Query VoteItem.find(:all, :joins => :votes, :select => "votes.*, votes.count vote_count", :conditions => {:votes => {:user => @users}}, :group => "vote_items.id", :order => "vote_count DESC") Error Mysql::Error: Unknown column 'votes.count' in 'field list': SELECT votes.*, votes.count vote_count FROM `vote_items` INNER JOIN `votes` ON `votes`.voteable_id = `vote_items`.id AND `votes`.voteable_type = 'VoteItem' WHERE (`votes`.`user` IN (1,656,1311,1966,2097,2228,2883,3538,3669,4717,5765,6027,6420)) GROUP BY vote_items.id ORDER BY vote_count DESC ActiveRecord::StatementInvalid: Mysql::Error: Unknown column 'votes.count' in 'field list': SELECT votes.*, votes.count vote_count FROM `vote_items` INNER JOIN `votes` ON `votes`.voteable_id = `vote_items`.id AND `votes`.voteable_type = 'VoteItem' WHERE (`votes`.`user` IN (1,656,1311,1966,2097,2228,2883,3538,3669,4717,5765,6027,6420)) GROUP BY vote_items.id ORDER BY vote_count DESC There is no votes.countin vote_items. Here are the tables.
VoteItemid: integer, option: string, info: string, created_at: datetime, updated_at: datetime, vote_topic_id: integer
Voteid: integer, vote: boolean, voteable_id: integer, voteable_type: string, voter_id: integer, voter_type: string, created_at: datetime, updated_at: datetime
end