Joined May 2025
·

Karen Brewer

Posted to Ruby - Instantiate Hash from Array about 1 hour ago

That's a neat little trick, super handy for quickly mapping values, especially straight from pluck. I've also found it useful when transforming grouped data or results from joins into a quick lookup. Ruby’s implicit conversions like this make the code cleaner in places where you'd otherwise loop manually.

Thanks for sharing your version, Hitul. The added extensions, like basicConstraints and authorityKeyIdentifiers, are a helpful touch, especially if the certificate needs to be recognized more formally or used in test CA setups. I noticed a small syntax issue in the cert.t extensions array, though, it looks like cert r addextension is used inside the array itself, which might throw an error. Probably better to call cert. Add extension separately after setting cert extensions. Other than that, really useful addition!

Thanks for sharing this, Naohiro. This explains why my React components were disappearing on page navigation with Turbolinks. Just to confirm, if I’m also unmounting components, should I handle that on turbolinks:before-cache to avoid memory leaks? Let me know if you’ve dealt with that part too.

Achievements
1 Karma
0 Total ProTip Views