Skip to content

ActiveBehaviour fix for junction tables#3027

Open
SpawnCycle wants to merge 1 commit intoSeaQL:masterfrom
SpawnCycle:master
Open

ActiveBehaviour fix for junction tables#3027
SpawnCycle wants to merge 1 commit intoSeaQL:masterfrom
SpawnCycle:master

Conversation

@SpawnCycle
Copy link
Copy Markdown

@SpawnCycle SpawnCycle commented Mar 30, 2026

PR Info

Fixes the odd behavior with junction tables when using ActiveModelEx

Bug Fixes

  • ActiveModelBehavior is now triggered for the junction table when adding a via model

Changes

  • Adds a Send constraint in the establish links function
  • Runs ActiveBehavior for via_models

@SpawnCycle SpawnCycle requested a review from Huliiiiii March 30, 2026 17:37
@SpawnCycle
Copy link
Copy Markdown
Author

While exploring the repo I saw near-identical code in sea-orm-sync, should I add the changes to it too?

@Huliiiiii
Copy link
Copy Markdown
Member

It has been fixed on master. You can just rebase.

@SpawnCycle
Copy link
Copy Markdown
Author

Will do, but what about establish_links in sea-orm-sync?

@Huliiiiii
Copy link
Copy Markdown
Member

You can run build-tools/make-sync.sh to sync changes.

@SpawnCycle
Copy link
Copy Markdown
Author

Mysql and mariadb don't support returning syntax, so as it is currently the after_save won't run on them

@SpawnCycle
Copy link
Copy Markdown
Author

I don't see a way around individual inserts

@SpawnCycle SpawnCycle changed the title Partial ActiveBehaviour fix for junction tables ActiveBehaviour fix for junction tables Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ActiveModelEx odd ActiveModelBehavior with a junction table

2 participants