lundi 24 août 2015

Find records where field value is all LOWERCASE

In a Rails 3.2 app I have a Tag model and want to find all records where the value in the name:string field is all lowercase.

Thus the activerecord query (on Postgres) would return Tag(id: 1, name: 'test') but not Tag(id:2, name: 'Test').

I'm sure there's a straightforward way to do this but I haven't been able to produce a working query!

Aucun commentaire:

Enregistrer un commentaire