Displaying 1 result from an estimated 1 matches for "flight_id".
2006 Aug 08
1
Best way to get data from n+1 models
...full map of
the plane I need to get all the data from both models, on a specific
date and time. So if I have:
class Ticket extends ActiveRecord::Base
end
class Reservation extends ActiveRecord::Base
end
I could ask for tickets and reservations like
t = Ticket.find(:all,:conditions=>["flight_id=? and
date=?",flight,date])
r = Reservation.find(:all,:conditions=>["flight_id=? and
date=?",flight,date])
And get the full map with t.concat(r). That was an answer for my
previous question and I thank you dudes for that.
My doubt now is what''s the best place to put...