In Ruby, you have a choice: define classes or modules either inline or nested within another module. While both approaches achieve similar results, there are key functional differences to consider, making nesting the preferred approach. The Subtle Distinction in Referencing Let’s look at an example using User and Admin::User classes: module Admin class Nested #…
Category: ruby
SPA without touching Javascript – The magic of Ruby on rails and Hotwire
It’s been a while since I wrote the last post here, so I decided to write something fun and maybe a good sample for anyone that is learning rails or is a little outdated. The idea here is to write a simple CRUD from scratch, I’ll use a Grid layout to keep everything in the…
I see Dead Jobs everywhere (sidekiq DeadSet)
When you are using Sidekiq to handle asynchronous jobs, some times there are exceptions and jobs failing, and I say sometimes because your environment is probably perfect, there is no lag, all services your jobs depend on are always on and responsive, and you probably write better code than most other developers 😛 otherwise it…
Ruby 3.2.0 released with WASI, YJIT, RegExp improvements, …
Last 25 of December while we were all celebrating with our families the Ruby core team released our Christmas gift. The release 3.2.0 of Ruby is faster and brought some amazing tools for us. WebAssembly support Ruby 3.2.0 added initial support for WebAssembly through WASI, this allows running CRuby in a web browser, for example…