Case Insensitive Where Statement Using SQL In Rails

Posted by Weston Ganger

If you want to make your where statement case insensitive on a column you can use the SQL function lower

I needed this for some import / export scripts I was running.


val = 'rails'
Post.where('lower(title) LIKE ?', val)


Related External Links:

Article Topic:Software Development - Rails

Date:January 29, 2016

Recommended Posts

Contact

604-309-8713
info@solidfoundationwebdev.com

Send Me A Message

I would love to get in touch and talk about your next project. Feel free to send a message and I will get back to you shortly.

Get Connected