Let’s assume that in our health care application we have a page which shows all Patients. This page also has a filter and it allows us to filter patients by their name.
We could implement the filter as shown here.
Patient.where("lower(first_name) = ?", first_name.downcase)
Read more about this at: Rails 5 Expression Indexes & Operator Classes support