Closed arthurfranca closed 5 years ago
Thanks, I'll check that. Should call beforeSave
hook only once.
Postgres only:
beforeSave
was called once for the initial create (Multi insert) and a second time for an additional save. In order to mix new records with existing records, the second save call was added to make sure that everything got stored.
I've added additional code to ignore the second save for already inserted records.
Thanks
Please check v.2.8.3
Model.create([oneObject])
(array argument) is running beforeSave/beforeValidation twice First timerecord.isNewRecord
equals true. Second onerecord.isNewRecord
equals false