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
|
||||
|
||||
def has_children?
|
||||
@has_children ||= (id && Category.where(parent_category_id: id).exists?) ? :true : :false
|
||||
@has_children == :true
|
||||
return @has_children if defined?(@has_children)
|
||||
@has_children = (id && Category.where(parent_category_id: id).exists?)
|
||||
end
|
||||
|
||||
def uncategorized?
|
||||
|
|
Loading…
Reference in New Issue