lundi 20 avril 2015

How can I display products that are booked in the future?

So I have 3 models - booking, marquee, businessuser. Booking belongs to marquee, marquee belongs to businessuser and businessuser has many marquees.

I am trying to create a find/where clause in my application helper that will only return marquees that are > current date and are belong to a booking (i.e booking has their id).

What I am currently able to display is bookings that have marquees. But I want it to display marquees that are booked.

This is the method I have in the application helper

 def upcomingbookings

 @bookings = Booking.all
 @futuremarquees = Booking.where("marquee_id")



end

Aucun commentaire:

Enregistrer un commentaire