#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
Let's say 50 users have voted on VoteItem1, what's the best way to find out, what other VoteItem(s) a majority of those same 50 users have voted on?
Thanks