#Vote Model
belongs_to :voteable, :polymorphic => true
belongs_to :voter, :polymorphic => true
#votes table
Voteid: integer, vote: boolean, voteable_id: integer, voteable_type: string, voter_id: integer, voter_type: string, created_at: datetime, updated_at: datetime
#User
has_many :voteables, :foreign_key => :voter_id, :class_name => "Vote"
has_many :votes, :foreign_key => :voter_id
#Vote_Item model
acts_as_voteable
has_many :voters, :class_name => "Vote", :foreign_key => :voteable_id
50人のユーザーがVoteItem1に投票したとしましょう。これを見つけるための最良の方法は何ですか、同じ50人のユーザーの過半数が投票した他のVoteItemは何ですか?
ありがとう