不要怂,就是干,撸起袖子干!

Commit 1524d2d6 by Jan Aagaard Meier

Merge pull request #4173 from elvo86/patch-1

[ci skip] Fix documentation of fields filter for create function
2 parents c1de6f1f 17c7a4f0
Showing with 1 additions and 1 deletions
...@@ -66,7 +66,7 @@ Task.create({ title: 'foo', description: 'bar', deadline: new Date() }).then(fun ...@@ -66,7 +66,7 @@ Task.create({ title: 'foo', description: 'bar', deadline: new Date() }).then(fun
It is also possible to define which attributes can be set via the create method. This can be especially very handy if you create database entries based on a form which can be filled by a user. Using that would for example allow you to restrict the `User` model to set only a username and an address but not an admin flag: It is also possible to define which attributes can be set via the create method. This can be especially very handy if you create database entries based on a form which can be filled by a user. Using that would for example allow you to restrict the `User` model to set only a username and an address but not an admin flag:
```js ```js
User.create({ username: 'barfooz', isAdmin: true }, [ 'username' ]).then(function(user) { User.create({ username: 'barfooz', isAdmin: true }, { fields: [ 'username' ] }).then(function(user) {
// let's assume the default of isAdmin is false: // let's assume the default of isAdmin is false:
console.log(user.get({ console.log(user.get({
plain: true plain: true
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!