FIX: id is always true since it's been to_i'd
Let's only look up the category if the id has been provided
This commit is contained in:
parent
1352a5b5fa
commit
594925b896
|
@ -360,7 +360,7 @@ class ListController < ApplicationController
|
||||||
@category = Category.query_category(slug_or_id, parent_category_id)
|
@category = Category.query_category(slug_or_id, parent_category_id)
|
||||||
|
|
||||||
# Redirect if we have `/c/:parent_category/:category/:id`
|
# Redirect if we have `/c/:parent_category/:category/:id`
|
||||||
if id
|
if params.include?(:id)
|
||||||
category = Category.find_by_id(id)
|
category = Category.find_by_id(id)
|
||||||
(redirect_to category.url, status: 301) && return if category
|
(redirect_to category.url, status: 301) && return if category
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue