FIX: Make category slug validation less strict (#8915)

This was changed recently and caused issues saving old categories which
already had digits at the beginning of the slug (for example, '30-days').
This commit is contained in:
Dan Ungureanu
2020-02-11 17:01:12 +02:00
committed by GitHub
parent 902d0e1e3a
commit ecaf2c2f4e
6 changed files with 17 additions and 13 deletions

View File

@ -324,7 +324,7 @@ class ListController < ApplicationController
end
# Legacy paths
if @category.nil? && parts.last =~ /\A\d+-/
if @category.nil? && parts.last =~ /\A\d+-category/
@category = Category.find_by_id(parts.last.to_i)
end
end