I found a method that works from here. I don’t understand what the “&” symbol is doing – maybe it’s shorthad for “object” since in my case “:lastname” is an attribute of the object that make up the array.
users = users.sort_by &:lastname
note: I don’t undertand why but a destructive version won’t work. It produces a “undefined method `sort_by!’ for #” errror:
users.sort_by! &:lastname