Skip to content

Instantly share code, notes, and snippets.

@yoshuawuyts
Last active August 29, 2015 14:03
Show Gist options
  • Save yoshuawuyts/7cb5ccd3925bb2ad58e3 to your computer and use it in GitHub Desktop.
Save yoshuawuyts/7cb5ccd3925bb2ad58e3 to your computer and use it in GitHub Desktop.

This:

model
  .attr('hands', {required: true})
  .attr('feet', {required: false})

Maps to this:

{ 
  hands: {
    required: true
  },
  feet: {
    required: false
  }
}

Now, what would map to this?:

{
  hands: {
    required: true
  },
  feet: {
    required: false,
    toes: {
      type: 'string'
    }
  }
}
@rickpastoor
Copy link

Easy way out:

model
  .attr('hands', {required: true})
  .attr('feet', {
    required: false,
    toes: { type: 'string' }
  })

@aars
Copy link

aars commented Jul 7, 2014

Wat Rickt zegt. Maar dat ligt zo voor de hand dat ik vermoed dat je er een probleem mee hebt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment