Why is Model.scoped generating invalid SQL?
- by Nicholas H.
When I run Book.scoped({:conditions => ['books.index LIKE ?','%query%']}) I get:
ActiveRecord::StatementInvalid: SQLite3::SQLException: near "index": syntax error: SELECT * FROM "books" WHERE (books.index like '%query%')
What am I doing wrong?