diff options
author | Logan Hunt <loganhunt@simponic.xyz> | 2022-04-13 13:13:41 -0600 |
---|---|---|
committer | Logan Hunt <loganhunt@simponic.xyz> | 2022-04-13 13:13:41 -0600 |
commit | 77d572796ca940e3eb5edd1192f8cd127286284e (patch) | |
tree | 228d42c390ce68e57b8cd432d88dd57215c02771 /lib/aggiedit/rooms.ex | |
parent | 9d5a369ff6aa2dc3a80f104ffdc622ddf594a725 (diff) | |
download | aggiedit-77d572796ca940e3eb5edd1192f8cd127286284e.tar.gz aggiedit-77d572796ca940e3eb5edd1192f8cd127286284e.zip |
Update roles and list posts from room
Diffstat (limited to 'lib/aggiedit/rooms.ex')
-rw-r--r-- | lib/aggiedit/rooms.ex | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/lib/aggiedit/rooms.ex b/lib/aggiedit/rooms.ex index 8f2e39f..1eb09f9 100644 --- a/lib/aggiedit/rooms.ex +++ b/lib/aggiedit/rooms.ex @@ -112,19 +112,14 @@ defmodule Aggiedit.Rooms do alias Aggiedit.Rooms.Post - @doc """ - Returns the list of posts. - - ## Examples - - iex> list_posts() - [%Post{}, ...] - - """ def list_posts do Repo.all(Post) end + def posts_in_room(room_id) do + Repo.all((from p in Post, where: p.room_id == ^room_id, select: p)) + end + @doc """ Gets a single post. |