lib/active_admin/menu.rb in activeadmin-1.3.1 vs lib/active_admin/menu.rb in activeadmin-1.4.0
- old
+ new
@@ -66,17 +66,11 @@
# Used in the UI to visually distinguish which menu item is selected.
def current?(item)
self == item || include?(item)
end
- # Returns sorted array of menu items that should be displayed in this context.
- # Sorts by priority first, then alphabetically by label if needed.
- def items(context = nil)
- @children.values.select{ |i| i.display?(context) }.sort do |a, b|
- result = a.priority <=> b.priority
- result = a.label(context) <=> b.label(context) if result == 0
- result
- end
+ def items
+ @children.values
end
attr_reader :children
private
attr_writer :children