mardi 1 décembre 2015

How to select a column field by joining two tables

i want to select amount by joining two tables. This is my active record. Through this i want to select 'amount' from 'programme' table with these conditions. Please help

Programme.joins(:subscriptions).where('programmes.coach_id=?',params[:id])

Aucun commentaire:

Enregistrer un commentaire