balderdashy / sails

Realtime MVC Framework for Node.js
https://sailsjs.com
MIT License
22.84k stars 1.95k forks source link

.create method storing undeclared attributes as data type value #6923

Open Prashant-Morem opened 4 years ago

Prashant-Morem commented 4 years ago

Node version: v13.0.1 Sails version (sails): 1.2.3 ORM hook version (sails-hook-orm): ^2.1.1 Sockets hook version (sails-hook-sockets): ^2.0.0 Grunt hook version (sails-hook-grunt): ^4.0.0 Sails mongo version (sails-mongo): ^1.0.1

This is master model

module.exports = {
  tableName: 'MASTER',
  schema: true,
  attributes: {
    name: {
      type: 'string',
      required: true
    },
    description: {
      type: 'string'
    },
  },
};

whenever i am not passing description column value in request then it is storing as empty string value like this:

{
  name : 'Swift',
  description : "",
};

But i don't want to store description value in database.i need help asap


sailsbot commented 4 years ago

@Prashant-Morem Thanks for posting! We'll take a look as soon as possible.

In the mean time, there are a few ways you can help speed things along:

Please remember: never post in a public forum if you believe you've found a genuine security vulnerability. Instead, disclose it responsibly.

For help with questions about Sails, click here.

johnabrams7 commented 4 years ago

@Prashant-Morem - Description is being defined as a default attribute (like the internal id, createdAt, and updatedAt default attributes unless disabled) and is still available in all models. If feasible, have you tried moving the description attribute to only specific models it is needed for?