Du kan order by
field + 0
for at ændre datatypen for field
til et tal implicit:
Model.order("field + 0 ASC")
# similar `string`.to_i in Ruby
# `1.record1` => 1
# `10.record10` => 10
Du kan order by
field + 0
for at ændre datatypen for field
til et tal implicit:
Model.order("field + 0 ASC")
# similar `string`.to_i in Ruby
# `1.record1` => 1
# `10.record10` => 10