Why are you doing this? If it performs a case-insensitive search, you can simply put it in your query logic (in fact, I think Rails does this a bit already). However, if you really want the data to be lowercase normalized in the database (say, if you are dealing with SHA1 hashes or something else), then you are doing the right thing.
source share