New topic Closed topic
avatar image
0
Clear a Has and Belongs to Many relationship at once?
By Created , last editted

Hi,


Is it possible to clear a Has and Belongs to Many relationship at once, without looping trough al the current values and remove them one at a time?

I've tried to assign an empty collection of the same model, but Betty doesn't accept this. When you assign nothing to the relation, in the update event, Betty will remove the "assignment" as soon as you save the update event.


Thanks,

Rob 


Hi,


Is it possible to clear a Has and Belongs to Many relationship at once, without looping trough al the current values and remove them one at a time?

I've tried to assign an empty collection of the same model, but Betty doesn't accept this. When you assign nothing to the relation, in the update event, Betty will remove the "assignment" as soon as you save the update event.


Thanks,

Rob 

Answers
Sort by:

This topic is closed.