Update index.js

https://github.com/balderdashy/sails/issues/1444

The error was being thrown due to no id value being presented to the publishUpdate method. This was due to an improper reference to the associated model's id value.

I do not know if this pertains as well to the to-many relationship, as I was dealing with a one-to-many relationship.

An id value will now be properly presented. The ReferencedModel.primaryKey (which equals id) was being called on an integer, causing no value to be presented.