I'll add a comment in the code

I tried the condition as `id =~ /^0-9$/`which doesn't work for both numbers and strings, and then I had it as `(Integer(id) rescue false) ? :id : :name` which made my head hurt for some reason.