mercredi 4 février 2015

Rails3: conversion of RoR sqlite to postgresql for Heroku

I'm not familiar with postgresql and I have this code working on my local dev machine with SQLite, but it fails in my production Heroku environment which uses postgresql



> @categories = @user.posts.includes(:category).where(
> ['`categories`.name = ?', params[:category]])


Error in heroku logs:



ActiveRecord::StatementInvalid (PG::SyntaxError: ERROR: syntax error at or near "."
2015-02-04T11:38:35.977789+00:00 app[web.1]: LINE 1: ..._id" WHERE ("posts".user_id = 2) AND (`categories`.name = 'm...
2015-02-04T11:38:35.977791+00:00 app[web.1]: ^

Aucun commentaire:

Enregistrer un commentaire