I’ve got a database schema that is an artist with many tour_dates. I’m
trying to grab the artist info and active tour dates at the same time.
In the controller:
@artist = Artist.find(params[:id], :include => :tour_dates)
Now I want to include only the tour_dates that happen after the first of
the current month. This is what I tried:
@artist = Artist.find(params[:id], :include => :tour_dates.active_dates)
:conditions => “date > now()”,
:order => “date”)
to the tour_date model, just to see if i could get tour_dates after
right now to display. It doesn’t work quite the way I’d expect. How
would you do this? If you need to see more of my models or controllers
let me know.
I’m really just getting rolling on this so any help is appreciated.
I’ve got some books, I just didn’t see anything like this in them.
I also am grabbing
@artists = Artist.active_artists (similar model to the above) for a menu
on the page, which I realize may be redundant, but I can’t figure out
how to grab all the artist names and ids, but also everything for one