Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does Rails (5.2+) ActiveSupport::CurrentAttributes have same functionality as this gem? #85

Open
eoinkelly opened this issue Feb 17, 2022 · 2 comments

Comments

@eoinkelly
Copy link

It seems like Rails' built-in (since 5.2) ActiveSupport::CurrentAttributes has the same functionality as this gem.

If my reading is correct then I think we should add a note to the README explaining this and perhaps encouraging using that instead. If I'm wrong then a note explaining the difference would be equally useful.

@steveklabnik
Copy link
Owner

I haven't used Rails since Rails 4, if anyone knows this answer, I would be happy to take a PR explaining it.

@alexeyr-ci
Copy link

alexeyr-ci commented Jul 13, 2023

E.g. I use RequestStore to make sure a <script> tag only gets inserted once even if a partial which includes it is rendered several times. It very much doesn't fall under

The attributes stuck in Current should be used by more or less all actions on all requests. If you start sticking controller-specific attributes in there, you're going to create a mess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants