Hello - I recently updated a few gems locally in one of my apps (including Trestle 0.9.5 to 0.9.7), and for some reason this broke Trestle pages in the app, with a fairly cryptic error:
After a lot of digging, I realised it was because some of our menu items had their names defined as symbols (eg :blog_posts), and some as strings ("Longer name written as string"), so because Menu::Item#<=> looks at the name, and because :symbol <=> "string" returns nil, this was breaking the sorting (but coming from quite a deep place).
It's quite a simple fix, but happy to share a bit more context if it's helpful!
Hello - I recently updated a few gems locally in one of my apps (including Trestle 0.9.5 to 0.9.7), and for some reason this broke Trestle pages in the app, with a fairly cryptic error:
After a lot of digging, I realised it was because some of our menu items had their names defined as symbols (eg
:blog_posts
), and some as strings ("Longer name written as string"
), so becauseMenu::Item#<=>
looks at thename
, and because:symbol <=> "string"
returns nil, this was breaking the sorting (but coming from quite a deep place).It's quite a simple fix, but happy to share a bit more context if it's helpful!