lundi 11 mai 2015

generating a row depending on 5 distinct tables rails 3.0.1 ruby 1.8.7

i have to generate a report that needs to compare data from 5 tables (Us,Or,P,R,OrP) like this:

Us has many Or (us_id in Or) P has many children of itself through the field father_id Us and P has many R (us_id and p_id in R) Or and P has many of each other through OrP(or_id and p_id in OrP)

i need to bring all the registers in P, per Us where P and Us are not in R

on top of that, i need to bring the father of those where the father_id is not null.

I can't think clearer than that right now, sry about it.

if you downvote, at least tell me why

Aucun commentaire:

Enregistrer un commentaire