Used Active Record to sort pins