mirror of
https://github.com/discourse/discourse.git
synced 2025-06-09 17:28:13 +08:00
FIX: Allow a search for a parent slug when a child exists with the same
name.
This commit is contained in:
@ -309,7 +309,7 @@ SQL
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.query_parent_category(parent_slug)
|
def self.query_parent_category(parent_slug)
|
||||||
self.where(slug: parent_slug).pluck(:id).first ||
|
self.where(slug: parent_slug, parent_category_id: nil).pluck(:id).first ||
|
||||||
self.where(id: parent_slug.to_i).pluck(:id).first
|
self.where(id: parent_slug.to_i).pluck(:id).first
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user