mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-24 04:27:59 +01:00
keep old slug when title is changed
This commit is contained in:
parent
a00cdab739
commit
014cb025fd
1 changed files with 0 additions and 2 deletions
|
@ -116,8 +116,6 @@ defmodule Philomena.Topics.Topic do
|
||||||
|> cast(attrs, [:title])
|
|> cast(attrs, [:title])
|
||||||
|> validate_required([:title])
|
|> validate_required([:title])
|
||||||
|> validate_length(:title, min: 4, max: 96, count: :bytes)
|
|> validate_length(:title, min: 4, max: 96, count: :bytes)
|
||||||
|> put_slug()
|
|
||||||
|> unique_constraint(:slug, name: :index_topics_on_forum_id_and_slug)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def put_slug(changeset) do
|
def put_slug(changeset) do
|
||||||
|
|
Loading…
Reference in a new issue