I wanna sort by ISO3166::Country.find_country_by_alpha2(:country) where the :country column in my database contains the alpha2 so I created a function in my model and tried to use it in my controller order clause but it didn’t work Can someone please correct my syntax
model:
def country_iso_short_name
ISO3166::Country.find_country_by_alpha2(:country)
end