Tutorials
Expressive Class Hierarchies through Dynamically-Instantiated Support Objects | Fullstack Ruby
When you’re designing an abstract class for the purpose of subclassing—very common when looking at the framework/app divide—it’s tempting to want to throw a whole bunch of loosely-related functionality into that one parent class. But as we all kno...
Ruby 3.4, Range size Now Raises TypeError If The Range Is Not Iterable | Saeloun Blog
In Ruby, a Range is an object that represents a range of values with a defined beginning and end. It is a fundamental data structure used to express a sequence or span between two values, whether they are numeric, alphabetical, or even dates.We ha...
Testing anti-pattern: merged setup data - Code with Jason
In a single test file, there’s often overlap among the setup data needed for the tests in the file. For whatever reasons, perhaps in an effort to improve performance or avoid duplication, test writers often merge the setup code and bring it to the...
Less painful way to work with Shopify Graphql API in Ruby | Kirill Platonov
The shopify_graphql gem provides conventions and abstractions to make working with the Graphql API in Rails apps more convenientThe default way to work with Shopify API nowadays is Graphql. Most new API feature are strictly Graphql exclusive. This...
Hidden feature of Turbo: stream actions inside regular HTML | Radan Skorić's personal site
Turbo stream actions are a central feature of Turbo, allowing for control of the webpage from server side. In essence, turbo stream actions are a piece of custom HTML markup that Turbo has a special way of interpreting as an action to execute rath...
How We Used a Custom Enumerator to Fix a Production Problem
It runs a Microsoft SQL Server query that returns an array of property IDs. In Ruby, arrays implement the Enumerable interface by default, so we can use the rich assortment of Enumerable methods to iterate over them.Other methods from the same cla...
Running Solid Queue in production Rails apps - Honeybadger Developer Blog
Solid Queue is a new backend for ActiveJob. It was announced at Rails World, along with Solid Cache. Like Solid Cache, Solid Queue moves away from memory solutions like Redis and towards the database. Solid Queue takes advantage of speed increases...