class RankingController < ApplicationController
  def have
    @items = Have.select("items.id, count(1) as have_count, items.*").group("items.id").order('have_count desc').joins("LEFT OUTER JOIN items ON items.id = ownerships.item_id")
  end
  def want
    @items = Want.select("items.id, count(1) as want_count, items.*").group("items.id").order('want_count desc').joins("LEFT OUTER JOIN items ON items.id = ownerships.item_id")
  end
end
