On my local server (rails & MySQL) I can run a simple search like this:
find(:all, :conditions => ['name LIKE ?', "%#{search}%"])
Where I pass in the search parameter and it tries to match that to the name field in a particular model. However, I get no results in my application on heroku, and in the heroku console i also get no results.
I know heroku doesn’t run MySQL, can anyone explain why this doesn’t work and the simplest way around it.
UPDATE:
After playing around and some research (now that I knew where to look), LIKE in MySQL is not case-sensitive. It still works on heroku, but was throwing me off because it is case-sensitive. ILIKE is solution for deployment on heroku.
I would really suggest running Postgres locally if you’re deploying to Heroku. No matter how good your code and tests, if you’re deploying to a different stack you’re going to see all sorts of problems.
In PG land, you’ll need this: