def check_category_father_circular_dependency
      return unless self.lato_blog_category_id

      all_children = self.get_all_category_children
      same_children = all_children.select { |child| child.id === self.lato_blog_category_id }

      if same_children.length > 0
        errors.add('Category father', 'can not be a children of the category')
        throw :abort
      end
    end
def check_category_father_circular_dependency
      return unless self.lato_blog_category_id

      all_children = self.get_all_category_children
      same_children = all_children.select { |child| child.id === self.lato_blog_category_id }

      if same_children.length > 0
        errors.add('Category father', 'can not be a children of the category')
        throw :abort
      end
    end
This function check the category parent of the category do not create a circular dependency.