I have created a complex object in rails with a principle parent object “Resume” it has a number of child objects for each section(“objective_section”, “contact_section”, etc), is there a way I can fetch all associated objects to the parent object Resume?
Share
If by fetch you mean load from the database all in one query, then sure:
If this is a common pattern and you want to DRY things up without much effort, you can throw this into a named_scope in your model: