There are two general questions:
Sort by database (optimus)
or, if you absolutely need to do something with ruby before sorting:
Non-localize the special character to order: "Äððß" .uncolate => "Andos"
you add an unnecessary function to a string and use for sorting maybe
class String
def uncolate
self.tr(SPECIAL_CHARS,SUBSTITUTE_CHARS)
end
end
And sorting:
international_things.sort_by{|i| i.international_attr.uncolate}
I hope this helps
source
share