How to do case-insensitive order in Rails with postgresql
LanecH's answer adapted for Rails 3+ (including Rails 4 and 5):
users = User.order('LOWER(name)')
Or create a named scope you can reuse:
class User < ActiveRecord::Base
scope :order_by_name, -> { order('LOWER(name)') }
end
users = User.order_by_name
result = Users.find(:all, :order => "LOWER(name)")
To take a little bit from both Brad and Frank.