これは私の開発環境では機能しますが、Postgres を使用して Heroku 経由で実行しようとすると、このエラーが発生します。
2012-04-07T21:35:14+00:00 app[web.1]: ActiveRecord::StatementInvalid
(PG::Error: ERROR: operator does not exist: integer == integer
2012-04-07T21:35:14+00:00 app[web.1]: LINE 1: ...."value") AS avg_id FROM "datapoints"
WHERE (habit_id == 1)
2012-04-07T21:35:14+00:00 app[web.1]: HINT: No operator matches the given name and argument type(s).
You might need to add explicit type casts.
2012-04-07T21:35:14+00:00 app[web.1]: : SELECT AVG("datapoints"."value") AS avg_id FROM "datapoints
WHERE (habit_id == 1)):
以下は、私のコントローラーからのコード行です。
Datapoint.average(:value, :conditions => ['habit_id == ?', self.habit_id])
私はレールにかなり慣れていないので、これは非常に単純な間違いである可能性があります.ここで私が間違っていることについて何か考えはありますか?