Skip to content

Instantly share code, notes, and snippets.

View csavage-mdsol's full-sized avatar

Connor Savage csavage-mdsol

  • Medidata Solutions
  • New York, New York
View GitHub Profile
@patmaddox
patmaddox / My question.txt
Created April 11, 2011 23:07
Question about case-insensitive columns in Rails
Hola Rails people. I have a column in my database that I need to treat
as case-insensitive. The standard solution to this is to downcase the
value before inserting it into the database, and when doing
searches. My problems with this are:
1. I have to make calls to String#downcase in several places where I
*really* mean "this is case-insensitive"
2. I can only provide automatic-downcasing when going through the API
I provide. Anyone calling MyClass.where(:name => foo) has to know to