Discussion
Loading...

Post

  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
Alexander Gräfe
@rickenharp@popkulturreferenz.de  ·  activity timestamp 6 days ago

I found an interesting way to combine dry-effects and #Hanami providers to implement a tidy current_account functionality:

https://ruby-heretic.com/posts/2025/10/dry-effects-implement-current-account/

Ruby Heretic

Using dry-effects to implement current_account

After switching to rodauth I was not quite happy with my implementation of the current_account feature. So I decided to dig a bit deeper into the documentation and found a really neat solution. I was already using dry-effects, but in a rather haphazard way. Looking at the documentation again, I decided to go the rack middleware route as well. If I put the new middleware after rodauth, I can grab the account_id from request.env[“rodauth”] and store it in the effects handler:
  • Copy link
  • Flag this post
  • Block
Log in

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.0-rc.3.21 no JS en
Automatic federation enabled
  • Explore
  • About
  • Members
  • Code of Conduct
Home
Login