Skip to content

ActiveRecord unlink() not applying events/behaviors on junction model - inconsistent with link() #37

Open

Description

@vercotux

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.

Activity

  1. machour commented on Jan 14, 2019

    @machour
    Member

    As I suspect this would break BC, maybe this should be moved to 3.x instead

  2. transferred this issue fromyiisoft/yii2on Jan 14, 2019
  3. samdark commented on Jan 14, 2019

    @samdark
    Member

    Moved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions