Skip to content

Instantly share code, notes, and snippets.

@whalec
Created August 6, 2011 05:10
Show Gist options
  • Save whalec/1129039 to your computer and use it in GitHub Desktop.
Save whalec/1129039 to your computer and use it in GitHub Desktop.
@timeline.map do |post|
{
:id => post.id,
:brand => {
:id => post.brand.id,
:name => post.brand.name,
:updated_at => post.brand.updated_at,
:attachments => post.brand.images.map do |image|
{
:id => image.id,
:style => image.styles,
:file => image.file_name,
:endpoint => image.base_url
}
end
},
:updated_at => post.updated_at
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment