Last active
August 29, 2015 14:18
-
-
Save jede/5567b6de9b3a2ee19482 to your computer and use it in GitHub Desktop.
validate.js data cleaner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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