I agree that request_store_rails would be an alternative solution for my problems.
request_store_rails
Maybe I'm missing something but the with block is the "clean up mechanism".
with
def with(request_value) if get.present? raise ContextAlreadyDefinedError, "Context already defined!" end begin @@request_value.value = request_value yield ensure @@request_value.value = nil # "clean up mechanism" end end
totally, my bad!
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I agree that
request_store_rails
would be an alternative solution for my problems.Maybe I'm missing something but the
with
block is the "clean up mechanism".totally, my bad!