i have a question about relationships. if i have the folowing
classes/tables:
project --1--------------n-- iteration
iteration has a attribut “start_date”. now i like to get all projects
whit at least one iteration where start_date = today. for other
calculatings i need all iterations related to this projects.
I’m not sure it’s a “refactoring” - it’s exactly the same thing. The
original poster seemed to imply that he conceptually wanted the method
to be accessible through the Project model, so that’s why I suggested
the convenience method I did.
this can’t work, because Project.find(:all) returns a array and this
dosn’t know the method iterations.
i’m not sure if this should happens by your code, but i need in the end
a array filed whit Project-objects whit all relatet Iterations - if it
is possible whit no extra query.
know someone a documentation for has_many whit a block given? there is
no word in the rails api about this.