I have a has_many association like this:
has_many :respostas_matriz_alternativas, :class_name => 'RespostaMatrizAlternativa',
:order => 'respostas_matriz.codigo asc',
:include => :resposta_matriz
Well the fragment that matters is the "order". Codigo is a varchar column wich will contain in most cases numeric values. To show this data I need to order it by code, but when I have only numbers the order becomes awkward, something like:
1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 2, 20, ...
What do you suggest for me to solve it?
Thanks.