Skip to content

Instantly share code, notes, and snippets.

@jede
Last active August 29, 2015 14:18
Show Gist options
  • Save jede/5567b6de9b3a2ee19482 to your computer and use it in GitHub Desktop.
Save jede/5567b6de9b3a2ee19482 to your computer and use it in GitHub Desktop.
validate.js data cleaner
data =
name: 'Test'
description: 'Yaay'
createdAt: 'omgomg'
constraints =
name:
presence: true
description: true
validate(data, constraints).then (params) =>
# params won't contain createdAt
User.create(params)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment