fixup! chore(chat): create more chats/messages + set membership
This commit is contained in:
parent
7f510ba9c7
commit
2063870a9e
@ -62,10 +62,13 @@ rooms_and_messages = [
|
||||
room: %{name: "the-shire", topic: "A peaceful place for hobbits"},
|
||||
messages: [
|
||||
{frodo, "What news of the outside world? Tell me everything!"},
|
||||
{gandalf, "What can I tell you? Life in the wide world goes on much as it has this past Age..."},
|
||||
{gandalf, "Full of its own comings and goings, scarcely aware of the existence of Hobbits..."},
|
||||
{gandalf,
|
||||
"What can I tell you? Life in the wide world goes on much as it has this past Age..."},
|
||||
{gandalf,
|
||||
"Full of its own comings and goings, scarcely aware of the existence of Hobbits..."},
|
||||
{frodo, "You're late!"},
|
||||
{gandalf, "A wizard is never late, Frodo Baggins. Nor is he early. He arrives precisely when he means to."}
|
||||
{gandalf,
|
||||
"A wizard is never late, Frodo Baggins. Nor is he early. He arrives precisely when he means to."}
|
||||
]
|
||||
},
|
||||
# Moria Room
|
||||
@ -95,11 +98,13 @@ rooms_and_messages = [
|
||||
|
||||
for %{room: room, messages: messages} <- rooms_and_messages do
|
||||
room = Room |> struct(room) |> Repo.insert!()
|
||||
|
||||
users =
|
||||
for {user, message} <- messages do
|
||||
Repo.insert!(%Message{user: user, room: room, body: message})
|
||||
user
|
||||
end
|
||||
|
||||
for user <- MapSet.new(users) do
|
||||
Repo.insert!(%RoomMembership{user: user, room: room})
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user