Tutorials


Improving Rails Migrations Using bulk: true - Mintbit
When working with Rails migrations, performance isn’t usually the first thing that comes to mind—until your schema starts getting big or you’re deploying changes to production environments with large databases. Fortunately, Rails provides a simple...

Use getter methods instead of instance variables in Ruby objects
When I think about a Ruby object I try to minimize the public methods that it exposes. My line of thinking is that all methods should be private unless there is a real reason to make that method public.
When making a method public you are signing...


Understanding Ruby’s `tap` — A Powerful Debugging and Configuration Tool - Harisankar P S | Ruby on Rails Developer
Ruby’s Object#tap is a small but powerful method that often goes unnoticed. It allows you to “tap into” a method chain, perform some operation, and return the original object—regardless of what the block inside returns. This makes it particularly ...

Fix N+1 Queries Without Eager Loading Using SQL Subquery
In this post, we'll learn how to use a SQL subquery in a Rails app to eliminate N+1 queries and improve performance. We'll profile a real-world example, showing how to fetch a single record from associated has_many records efficiently without eage...

Sanitize your strings in JavaScript like a Rails developer | Rails Designer
Bring a little Rails into your JavaScript with super useful sanitize method to strip unwanting characters from your content.Ruby (and Rails) are known for great Developer Experience. Not in the least because of the many little helpers available. J...

Extracting Deprecation Warnings From the Rails Source Code - FastRuby.io | Rails Upgrade Service
Learn how to extract deprecation warnings from the Rails source code, for each version of Rails, using the Abstract Syntax Tree (AST) and tree-sitterBefore doing an upgrade, we strongly recommend doing the Roadmap to Upgrade Rails opens a new wind...
