Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def results
- max = 0.0
- topic_votes.count(:all, :group => ['option_id']).tap { |a| max = a.max { |a, b| a[1] <=> b[1] }[1].to_f }.collect { |pair| [Option.find(pair[0]), pair[1] / max] }
- end
Add Comment
Please, Sign In to add comment