So in my proyect you can make purchases with have products in them, this is represented in my db by a HABTM association between them, the thing is, i prepare the array to save the data using $this->purchase->saveAll and if the purchase has a duplicate product in it it will only add that record once.
Here is the [array]
that im passing the saveAll() funtcion.
After that array gets saved the only records added to products_purchases are one for product_id 54 and one for product_id 15, as opposed to the two records i want from product_id 54 and the one for 15.
If i havent explained myself clearly, please, let me know.