class ActiveAdmin::MenuItem

def ancestors

The first item is the immediate parent fo the item
Returns an array of the ancestory of this menu item
def ancestors
  return [] unless parent?
  [parent, parent.ancestors].flatten
end