diff --git a/backend/adonis.js b/backend/adonis.js index 7f9c9bc..62eb1ab 100644 --- a/backend/adonis.js +++ b/backend/adonis.js @@ -277,10 +277,10 @@ instance.merge(jsonAttributes) // Modifies the specified attribute instance.save() // Save the instance to the database. instance.delete() // Delete model instance from the database. -instance.associate(id) // Exclusive to belongsTo relationship, where it associates two model instances together. -instance.dissociate(id) // The opposite of associate, where you just drop the relationship -instance.attach([id, id...]) // Works with the belongsToMany relationship to attach a relationship inside the pivot table. -instance.detach([id, id...]) // The opposite of the attach method, and it removes the relationship from the pivot table only. +instance.associate(id) // Exclusive to belongsTo relationship, where it associates two model instances together. +instance.dissociate(id) // The opposite of associate, where you just drop the relationship +instance.attach(arrayOfIds, callback) // Works with the belongsToMany relationship to attach a relationship inside the pivot table. The attach method accepts an optional callback receiving the pivotModel instance, allowing you to set extra properties on a pivot table if required: +instance.detach(arrayOfIds) // The opposite of the attach method, and it removes the relationship from the pivot table only. /******************************************************************************************** * QUERY BUILDER