FIX: Failed to detect existing category permalink

This commit is contained in:
Gerhard Schlager 2019-03-13 20:41:57 +01:00
parent c34a6ba674
commit f3c76ad482
1 changed files with 1 additions and 0 deletions

View File

@ -585,6 +585,7 @@ class Category < ActiveRecord::Base
url = +"#{Discourse.base_uri}/c"
url << "/#{parent_category.slug}" if parent_category_id
url << "/#{old_slug}"
url = Permalink.normalize_url(url)
if Permalink.where(url: url).exists?
Permalink.where(url: url).update_all(category_id: id)