Skip to content

A platform for community discussion. Free, open, simple.

FIX: Don't use `:true`/`:false` symbols (#24861)

Jarek Radosz8355664c823e
diff --git a/app/models/category.rb b/app/models/category.rb
index ae393d7f93c..62228a02d0e 100644
--- a/app/models/category.rb
+++ b/app/models/category.rb
@@ -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?