我有以下代码行,在本地运行良好,但在推送到生产(Heroku)时会中断:
def self.find_unresolved_with_approved_client
self.joins(:client).where('clients.approved = true AND wish.status <> "Resolved"')
end
我的heroku日志中的错误如下:
2012-04-09T11:49:14+00:00 app[web.1]: ActionView::Template::Error (PGError: ERROR: column "Resolved" does not exist
2012-04-09T11:49:14+00:00 app[web.1]: 16: %th{ :class => :span10 } Subject
2012-04-09T11:49:14+00:00 app[web.1]: 17: %th{ :class => :span4 } Status
2012-04-09T11:49:14+00:00 app[web.1]: LINE 1: ...ERE (clients.approved = true AND wishes.status != "Resolved"...
2012-04-09T11:49:14+00:00 app[web.1]: : SELECT "wishes".* FROM "wishes" INNER JOIN "clients" ON "clients"."id" = "wishes"."client_id" WHERE (clients.approved = true AND wishes.status != "Resolved") ORDER BY wishes.id LIMIT 25 OFFSET 0):
当它在本地进行文字比较时,为什么要尝试在 Production 上进行列比较?