active-record
active-record copied to clipboard
ActiveRecord unlink() not applying events/behaviors on junction model - inconsistent with link()
When declaring a 'via' (not 'viaTable') relation the respsective behaviors of link()
vs unlink()
are a bit inconsistent.
link()
will trigger events and use behaviors on the junction model provided by the 'via' modelClass
while unlink()
will not.
I think it is really awesome that link()
uses insert()
on the junction model, but conversely unlink()
should also use delete()
on the junction model.
As I suspect this would break BC, maybe this should be moved to 3.x instead
Moved.