Replies: 1 comment
-
Hey! 👋 Your question is actually more related to Crystal than Marten. Unfortunately, there is no class Fiber
property current_user : Auth::User?
end But I don't think that this is a very clean approach to be honest. I would recommend against it and suggest passing values associated with the incoming request as arguments. |
Beta Was this translation helpful? Give feedback.
0 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.
-
Hi all
I think in Rails we can use
Thread.current
to associate data from the controller down to the model, without having to pass them manually as an argument. This sometimes is beneficial, for example to getcurrent_user
in the model. I know, we can pass it as an argument, but imagine some valid scenario why doing something like that would be troublesome.So... do we have something to save data to which we can then retrieve from, and that this object that handling this is unique per request?
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions