I have found that this code as outlined in documentation throws an error:
when /^country_name_/
# This sorts by a student's country name, so we need to include
# the country. We can't use JOIN since not all students might have
# a country.
order("LOWER(countries.name) #{ direction }").includes(:country)
else
I had to change like this to work:
order("LOWER(countries.name) #{ direction }").includes(:country).references(:country)
I have found that this code as outlined in documentation throws an error:
I had to change like this to work:
order("LOWER(countries.name) #{ direction }").includes(:country).references(:country)