diff --git a/lib/bump/database.ex b/lib/bump/database.ex index fd0d6fb..459b745 100644 --- a/lib/bump/database.ex +++ b/lib/bump/database.ex @@ -9,13 +9,13 @@ defmodule Bump.Database do where: m.sender == ^sender, order_by: [desc: m.timestamp], limit: 1, - select: %{id: m.id, data: m.data, timestamp: m.timestamp} + select: %{id: m.id, title: m.title, data: m.data, timestamp: m.timestamp} res = Repo.one(query) if not is_nil(res) do Repo.delete_all(from m in "messages", where: m.id == ^res.id) - %{data: res.data, timestamp: res.timestamp} + %{title: res.title, data: res.data, timestamp: res.timestamp} else %{} end @@ -27,7 +27,7 @@ defmodule Bump.Database do where: m.sender == ^sender, order_by: [desc: m.timestamp], limit: 1, - select: %{data: m.data, timestamp: m.timestamp} + select: %{title: m.title, data: m.data, timestamp: m.timestamp} Repo.one(query) end @@ -40,7 +40,7 @@ defmodule Bump.Database do query = from m in "messages", where: m.sender == ^sender and m.timestamp >= ^ago, - select: %{data: m.data, timestamp: m.timestamp} + select: %{title: m.title, data: m.data, timestamp: m.timestamp} Repo.all(query) end