Replies: 4 comments 2 replies
-
|
Rails also wrap Thread.current and Thread.local into readily usable primitive: |
Beta Was this translation helpful? Give feedback.
-
|
Hey! I remember you asked a similar question a few months ago: #310 |
Beta Was this translation helpful? Give feedback.
-
|
Ah yes. My bad... got it. |
Beta Was this translation helpful? Give feedback.
-
|
So... meaning Marten is Fiber-based. How shall we set it from middleware/controller and get it from the model? 🤔 sorry so new here. Thanks. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
As per succinctly explained in this article, there are times we want to know who's making some changes to the data. In Rails, we can use
Thread.localand store user information there, to later be retrieved from the model just fine. Is there similar or equivalent mechanism in Crystal/Marten? Otherwise, we'll have to always defineperformerproperty and then set it out from the route/controller.I guess there's no other way, but I just want to ensure and discuss, out of my limited knowledge. Thanks :)
Beta Was this translation helpful? Give feedback.
All reactions