My code runs fine for sqllite locally, but when I push to heroku I get:
ActiveRecord::StatementInvalid (PGError: ERROR: syntax error at or near "NULL"
LINE 1: ...LECT "beeps".* FROM "beeps" WHERE ((widget_id NOT NULL) AND ...
^
: SELECT "beeps".* FROM "beeps" WHERE ((widget_id NOT NULL) AND (updated_at > '2011-02-06 02:27:59.867809') AND (userphone = '0000000xxxx') AND (beeper
= '0000000zzzz') AND (inbound = 't')) ORDER BY beeps.id DESC LIMIT 1):
the ruby code is :
Beep.last(:conditions => [ "(widget_id NOT NULL) AND (updated_at > ?) AND (userphone = ?) AND (beeper = ?) AND (inbound = ?)", 5.minutes.ago, aphone, beeper, inboundflag ])
By the way, is there any way to structure this query using pure active record, so we can (hopefully) avoid database-specific query strings?