Developer tips How to Navigate an Unfamiliar Open Source Codebase Fast A gem is misbehaving and the docs don’t cover your case. You clone it, open the source, and there are 340 files. The instinct is to start at the top of the directory
Rails-code Soft Delete Records In Rails Without A Gem Using Discarded_at Some records should disappear from the application without leaving the database — orders referenced by invoices, users referenced by audit logs. A nullable timestamp column and a default scope gives you soft deletion
Rails Turbo Native — Wrapping Your Rails App in an iOS and Android Shell A native app is three codebases: the web app, the iOS app, and the Android app, each reimplementing the same screens and drifting apart. Turbo Native takes a different position — your Rails
Developer tips Writing Changelogs That Developers Actually Read Most changelogs are a dump of commit subjects. “Merge pull request #412 from feature/fix-thing”, “wip”, “address review comments”. Nobody reads them, so nobody maintains them, so they get worse — and the one
Rails-code Add A Custom Computed Column To An Activeadmin Index Page The default ActiveAdmin index lists raw columns. Real admin screens need derived values — a total from associated rows, a status badge, a link to a related record — and the column block
Ruby 3 Frozen String Literals in Production — Real Wins and the Gotchas Nobody Mentions The # frozen_string_literal: true magic comment sits at the top of nearly every file in a modern Ruby codebase, added by RuboCop, accepted without much thought. It’s a genuine optimization — measurably fewer
Developer tips The Pull Request Description Nobody Writes (But Everyone Needs to Read) Most pull request descriptions say some version of “fixes the bug.” The diff is four hundred lines across eleven files. Your reviewer opens it, has no idea what problem you were solving or
Rails-code Test Action Mailer Content With Rspec Matchers In Rails Mailers break quietly — a renamed method in a template, a missing interpolation, a recipient list that silently resolves to nil. None of it surfaces until a customer says they never got the
Rails counter_cache and touch — Derived Data in Rails Without the Extra Query An index page listing fifty posts, each showing a comment count, issues fifty-one queries. The fix is well known — counter_cache — and it’s usually applied incorrectly, either by forgetting the backfill, by
Developer tips Async Code Review — How to Collaborate Without Blocking Each Other You open a PR at 4pm Kathmandu time. Your reviewer is asleep in Lisbon. They review at 9am theirs, leave four questions, and go into meetings. You answer at 6pm yours. They respond
Rails-code Serialize Query Params Back Into A Url String In Rails Filter forms, pagination links, and sort toggles all need to rebuild the current URL with one parameter changed and the rest preserved. Doing it with string concatenation breaks on the first array parameter
Ruby-code Truncate A String At A Word Boundary In Ruby Without Cutting Mid Word Cutting a string at a fixed character count produces things like “The quick brown fo…”. Truncating at the last whole word before the limit reads properly and is what you want for previews,
Ruby-code Extract Unique Values From An Array Of Hashes By A Key In Ruby You have a list of records and you want every distinct value of one field — all the account ids in a batch, every category present in a result set, the set of
Ruby 3 Ruby's Object Model — Eigenclasses, Method Lookup, and What super Really Does You can write Ruby for years without knowing what an eigenclass is. Then one day a gem defines a method you can’t find with grep, super calls something you didn’t expect, and define_method
Rails ActiveRecord::Store — Structured Data in One Column Without a Migration Per Field Some data doesn’t deserve a column. User interface preferences, per-account feature toggles, the last three filters someone applied to a report — attributes that are read constantly, queried almost never, and change shape