How to manage `belongs_to` relations
I have this action in my resource
but when I create a new token, the user and user_id are nil
7 Replies
Ah, so I think the issue is the
on_match
option. I believe you want on_lookup: :relate
Alternatively, you can use type: :append_and_remove
That is the generalized type for "add the new thing, remove the old thing if it exists" without creating or deleting anything (only changing what is related)Thanks that fixed it 🙌🏼
nearly finished moving everything over to Ash so I can do one mamoth commit today ~60 files changed
Thats awesome 😄
Is your project open source?
Sadly not 😞
No problem at all, just curious 😄 If you could write a few words on your migration experience that would be really cool. Perhaps posting something in #showcase .
Yeah I'm planning a personal blog post; no company engineering blog yet 🤣
excellent! Looking forward to it.