MySQL and Postgres

Hello all,

I’m a RoR begginer and am developing my app using MySQL but Heroku uses
Postgres, so my arel isn’t working quite properly.

I’ve searched about the outputted error but in my case, since I’m doing
a query between a HABTM table, things aren’t going so well.

Basically, a Product has_and_belongs_to_many Categories. My relation is
all set and everything works locally, but on deploy a 500 error occurs.

So without further delay, the issue is:

(…previous queries that work good locally and on heroku…)
if params[:fc].present? (checks if checkboxes have been ticked)
arel=arel.joins(‘INNER JOIN categories_products ON’)
arel=arel.where(‘categories_products.category_id in
(:fc_list)’, :fc_list => params[:fc]).uniq‘product_id’).having(‘count(category_id) =
:size’, :size => params[:fc].size)

So the idea is to allow the user to check a checkbox list and then
all the products that are in the checked categories.

My heroku error is: “” must appear in the GROUP BY clause or
be used in an aggregate function.

I know that there are already threads on this but none have fixed my

Thank you in advance.

Miguel A.