Skip to content

Instantly share code, notes, and snippets.

@phlipper
Created June 24, 2011 17:15
Show Gist options
  • Save phlipper/1045229 to your computer and use it in GitHub Desktop.
Save phlipper/1045229 to your computer and use it in GitHub Desktop.
event -> perspective -> attachment chain
@events = Event.all
for event in @events
# event has_many perspectives
for perspective in event.perspectives
# perspective has_many attachments
for attachment in perspective.attachments
# attachment has an asset with an url
puts attachment.asset.url
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment