trim whitespace (#55)
This commit is contained in:
parent
5be55c7387
commit
b2a0d688bb
2 changed files with 2 additions and 1 deletions
|
@ -18,6 +18,7 @@ defmodule Planner.Tasks.Plan do
|
|||
plan
|
||||
|> cast(attrs, [:description, :finished_at, :start, :end, :name])
|
||||
|> validate_required([:name])
|
||||
|> update_change(:name, &String.trim/1)
|
||||
end
|
||||
|
||||
def finish_plan(plan) do
|
||||
|
|
|
@ -18,7 +18,7 @@ defmodule Planner.Tasks.Task do
|
|||
task
|
||||
|> cast(attrs, [:value, :finished_at, :due_at])
|
||||
|> validate_required([:value])
|
||||
|> validate_length(:value, min: 3)
|
||||
|> update_change(:value, &String.trim/1)
|
||||
end
|
||||
|
||||
def finish_task(task) do
|
||||
|
|
Loading…
Add table
Reference in a new issue