I know very little about SQL. My app is running Rails 3.0.9. I have a search feature in my app which allows a user to search for photos, but right now the query only checks photo.name:
where("photos.name LIKE ?", "%#{search}%")
I would like it to ALSO check the photo.description for a match. I tried the following:
where("photos.name OR photo.description LIKE ?", "%#{search}%")
That seemed to actually work in development (I use SQLite in development), but once on Heroku, this code failed. What is the proper way to do this? Thanks.
You can try this