mirror of
https://github.com/discourse/discourse.git
synced 2025-02-06 03:18:23 +00:00
FIX: Don't use :true
/:false
symbols (#24861)
on line 252 `has_children` is set to true/false (actual booleans) which means `has_children?` was in some cases returning incorrect value…
This commit is contained in:
parent
607c530252
commit
8355664c82
@ -886,8 +886,8 @@ class Category < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def has_children?
|
def has_children?
|
||||||
@has_children ||= (id && Category.where(parent_category_id: id).exists?) ? :true : :false
|
return @has_children if defined?(@has_children)
|
||||||
@has_children == :true
|
@has_children = (id && Category.where(parent_category_id: id).exists?)
|
||||||
end
|
end
|
||||||
|
|
||||||
def uncategorized?
|
def uncategorized?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user