In my Rails app I\'ve run into an issue a couple times that I\'d like to know how other people solve:
I have certain records where a value is optional, so some recor
It seems like you'd have to do it in Ruby if you want consistent results across database types, as the database itself interprets whether or not the NULLS go at the front or end of the list.
Photo.all.sort {|a, b| a.collection_id.to_i <=> b.collection_id.to_i}
But that is not very efficient.