order forums by name

This commit is contained in:
byte[] 2019-11-17 17:55:20 -05:00
parent b9d4400c0c
commit fa8f969529

View file

@ -11,6 +11,7 @@ defmodule PhilomenaWeb.ForumController do
user = conn.assigns.current_user
forums =
Forum
|> order_by(asc: :name)
|> preload([last_post: [:topic, :user]])
|> Repo.all()
|> Enum.filter(&Canada.Can.can?(user, :show, &1))