defmodule Test.Posts.Post
belongs_to :user, User, on_replace: :mark_as_invalid
defmodule Test.Users.User
has_many :posts, Post
I tried reading the documentation and did not really understand what would happen here. Can someone explain exactly what this means here? does it mean if I delete the user then all the posts would be marked as invalid and essentially be orphaned? I tried locally and it seemed to delete all the posts which is why I am a bit confused.