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

Use Current Attributes for: Current.theme #1551

Closed
veganstraightedge opened this issue Apr 5, 2020 · 0 comments · Fixed by #1621
Closed

Use Current Attributes for: Current.theme #1551

veganstraightedge opened this issue Apr 5, 2020 · 0 comments · Fixed by #1621

Comments

@veganstraightedge
Copy link
Contributor

This also feels like a place that we could benefit from using CurrentAttributes (added in Rails 5.2).

They're thread locale globals. https://api.rubyonrails.org/classes/ActiveSupport/CurrentAttributes.html

Current.theme would be nice to be able to not only read easily, but set. So that that them can be rolled out iteratively and selectively disabled / default to the main. Eg, /admin won't be themed. It'd be nice to be able to set Current.theme = '2017' in a before_action in admin_controller.rb.

veganstraightedge added a commit that referenced this issue May 25, 2020
* Rename method set_locale_from_subdomain to set_current_locale

* Set Current.theme before each request

* Use Current.theme in Theme.name

* s/Theme.name/Current.theme

* Delete unused Theme model
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant