You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the only way to create/update related models is by injecting directly the user_id to the data on the Post model and accepting the user_id to be mass assignable, the method for creating looks like this:
Whereas now, since you're using the nested updater, you can't inject the user_id before saving.
An approach where you could ask the nested model updater to make() the model instead of persisting it wouldn't work, since that would break the post-persistence nested relation flow.
So, judging by your PR, your suggested approach would be something like:
If so, this makes sense. Let me think about it a bit further, and then I'll probably accept the PR.
I might change the name to make it clearer that this is an unguarded, 'unsafe' operation, though.
@czim I've seen that is not possible to achieve this:
the only way to create/update related models is by injecting directly the user_id to the data on the Post model and accepting the user_id to be mass assignable, the method for creating looks like this:
there is any workaround to prevent the creating to do this hacks?
Thanks.
The text was updated successfully, but these errors were encountered: