Modified to fix case insensitive sql using arel