Skip to content

Instantly share code, notes, and snippets.

@randallb
Created August 2, 2011 14:50
Show Gist options
  • Save randallb/1120345 to your computer and use it in GitHub Desktop.
Save randallb/1120345 to your computer and use it in GitHub Desktop.
for relation in relations
for key, value of relation
console.log "#{key}: #{value}"
if typeof value is "object"
for subkey, subvalue of value
console.log "inner: #{subkey}: #{subvalue}"
if subvalue is "newId"
console.log "I changed #{subkey} from #{subvalue} to #{id}."
value[subvalue] = id
console.log subvalue
console.log relations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment