Repository navigation
Updating ActiveModel with deeply nested ActiveModel structure after the fact #3181
Unanswered
leuchthelp
asked this question in
Q&A
Replies: 2 comments 2 replies
|
To better debug I serialized the whole execution as And I moved the |
0 replies
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hey there,
I'm currently in the process of implementing my indexing logic for a music library.
Repo can be found here
I'm currently getting the following runtime error (all below). Sadly the error is not really helpful as it doesn't quite tell me where I went wrong. There also seems to be no error in the
sqlwhich is strange.This probably boilds down to me abusing sea-orm but I sadly cannot figure out where exactly I might be going wrong.
What this is meant to do is described in the following:
The existing model is a
providers::ActiveModelEx. This is being initialized & lives at runtime to allow a user to authenticated against aProvider& gain access to the media saved with thatProvider.Media is being indexes as a
MediaItemwhich represents some album, playlist, genre, audio, etc.. AProviderknows which items it has provided which is why it gets updated with that information during indexing & only gets updated once indexing succeeds. I.e. the call to.add_media_item()updates aCloneof the currentproviders::ActiveModelEx& writes it back once finished.Since I understand updating, saving to require some
ActiveModelthis is what I opted to implement since it has the added benefit of automatically bundling the entire operation into one singleTransaction, but I am unsure if this is really the correct / intended way of doing something like this.Effectively the same thing now happens further down the callstack as a
MediaItemcan have multipleImages,Parentsor similar metadata in the form ofContent.So what a
providers::ActiveModelExsaves at the very end of this call would look a little something like this:I would really appreciated some insight & some help once this.
Thanks in advance.
Heres the offending code:
All reactions