If you want to choose differene sorting Algorithm for a particular case. use this Gem
jpcoderesearch
MIT