{"comment":{"url":"https://api.github.com/repos/balderdashy/waterline/comments/9517872","html_url":"https://github.com/balderdashy/waterline/commit/bb8822a203b7e8500da54c1e0fb22468e3828b16#commitcomment-9517872","id":9517872,"user":{"login":"nicoespeon","id":1094774,"avatar_url":"https://avatars.githubusercontent.com/u/1094774?v=3","gravatar_id":"","url":"https://api.github.com/users/nicoespeon","html_url":"https://github.com/nicoespeon","followers_url":"https://api.github.com/users/nicoespeon/followers","following_url":"https://api.github.com/users/nicoespeon/following{/other_user}","gists_url":"https://api.github.com/users/nicoespeon/gists{/gist_id}","starred_url":"https://api.github.com/users/nicoespeon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicoespeon/subscriptions","organizations_url":"https://api.github.com/users/nicoespeon/orgs","repos_url":"https://api.github.com/users/nicoespeon/repos","events_url":"https://api.github.com/users/nicoespeon/events{/privacy}","received_events_url":"https://api.github.com/users/nicoespeon/received_events","type":"User","site_admin":false},"position":28,"line":122,"path":"lib/waterline/model/index.js","commit_id":"bb8822a203b7e8500da54c1e0fb22468e3828b16","created_at":"2015-01-30T14:10:22Z","updated_at":"2015-01-30T14:10:22Z","body":"Doing this, our sails (REST) API is now returning every model with an extra `toJSON: null` property.\r\n\r\nDoing so, any further PUT request contains the object with the undesired `toJSON: null` property, which breaks sails server on update because it overrides model instance `.toJSON()` property. Hence, it fails to resolve `matchingRecord.toJSON()`, resulting in server crash: https://github.com/balderdashy/sails/blob/master/lib/hooks/blueprints/actions/update.js#L72\r\n\r\n\r\nIt was quite hard to debug since it was backed into a minor patch, which makes this bug appear suddenly yesterday (after an automated release), causing the server to crash / reboot every few minutes…\r\n\r\n\r\nWon't `delete obj.toJSON` be a better solution than setting it to `null`?\r\n\r\nBy the way, is it normal model attributes (= data properties) seems to be merged (= override) model instance methods? I mean, if you got a `toJSON` attribute in your database, it will make sails crash — I guess I must open an issue on the sails project for this one —."}}