I'm getting an error on a query in PostgreSQL in a rake task I'm trying to et up.
posts = Post.where("status IS ? AND publish_on < ?", 'queued', Time.now)
Here's the error:
PGError: ERROR: syntax error at or near "'queued'"
LINE 1: SELECT "posts".* FROM "posts" WHERE (status IS 'queued' AND...
^
: SELECT "posts".* FROM "posts" WHERE (status IS 'queued' AND publish_on < '2012-04-29 23:44:06.423516')
At first I thought it was the quotes, but changing them didn't work. Now I think it's probaly how I'm contstructing the and clause?