Ash FrameworkAF
Ash Framework4mo ago
1 reply
Marco Dell'Olio

destroy unmatching related associations

I'm currently trying to destroy the associations in case the attribute is an empty list with this change
      change manage_relationship(:owner_teams, :owner_teams,
               type: :direct_control,
               on_lookup: :ignore,
               on_match: :ignore,
               on_no_match: {:create, :upsert},
               on_missing: :destroy
             )


while the upsert part works just fine the destroy piece is not doing anything, and I yes I can confirm the attribute is an empty list.

Enum.map(teams_deduped, &to_owner_team/1) #=> []


Thank you
Was this page helpful?