Skip to content

Commit cb41e5f

Browse files
committed
Update seeds
1 parent 83e202c commit cb41e5f

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

priv/repo/seeds.exs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -222,22 +222,17 @@ end
222222
case Repo.all(Task) do
223223
[] ->
224224
for i <- 1..50 do
225-
markdown = "test *body* #{i}"
226-
options = %Earmark.Options{code_class_prefix: "language-"}
227-
html = Earmark.as_html!(markdown, options)
228-
229-
task = %Task{
225+
params = %{
230226
title: "test task #{i}",
231-
markdown: markdown,
232-
body: html,
233-
status: "open",
234-
number: i,
227+
markdown: "test *body* #{i}",
235228
project_id: 1,
236229
user_id: 1,
237230
task_list_id: Enum.random([1, 2, 3, 4])
238231
}
239232

240-
task |> Repo.insert!
233+
%Task{}
234+
|> Task.create_changeset(params)
235+
|> Repo.insert!
241236
end
242237
_ -> IO.puts "Tasks detected, aborting this seed."
243238
end

0 commit comments

Comments
 (0)