How to combine "change", "up", and "down" in a Rails migration
Rails migrations need path-specific logic for data updates while keeping rollback support. reversible, up_only, and reverting? handle direction-dependent SQL safely.
RubyMine users: you should be using bookmarks
Marking code lines in RubyMine helps revisit complex spots quickly and keep your place with anonymous or mnemonic bookmarks.
How the Date Header Affects Cookie Expiration and Caching
Cookie expiry and HTTP cache lifetimes depend on the Date header when present; missing it can make mocked-time tests and browser caching behave inconsistently.
How to enable Rails' file_fixture helper in FactoryBot
FactoryBot factories do not get Rails' file_fixture helper by default; including RSpec Rails file fixture support makes file_fixture available and sets the fixture path.
RSpec: Scoping custom matchers to example groups
Custom RSpec matchers can stay local to one example group or selected groups, avoiding global helper pollution while reusing expectation logic.
How to tackle complex refactorings in big projects
Large refactorings risk breaking tests, blocking releases, and entangling unrelated changes; breaking work into small green steps keeps long-running project changes manageable.
Getting permanent links to files on Github or Gitlab
Branch-based file links on GitHub and GitLab break when lines shift; commit- or tag-based URLs keep references stable.
TestProf II: Factory therapy for your Ruby tests—Martian Chronicles, Evil Martians’ team blog
Factories can make Ruby test suites slow by creating large association cascades and redundant records. TestProf helps identify factory hotspots with reports and flamegraphs.
Fragment Caching in Rails 7.1+ requires Haml 6
Rails 7.1 changes fragment cache behavior, breaking Haml 5 buffer patches in apps that use caching. Upgrading to Haml 6 is needed for Rails 7.1+ with fragment caching.
Text fragments in the browser URI fragment
URL text fragments let browsers deep-link to specific visible text without IDs, enabling highlighted shared links to arbitrary content.
How to enable pretty IRB inspection for your Ruby class
Custom Ruby objects can gain colored, multiline IRB output by defining pretty_print; pretty_inspect is a simpler fallback when pretty printing is not needed.
Generating an Entity Relationship Diagram for your Rails application
Rails apps can generate entity relationship diagrams to visualize model dependencies and export them as images or PDF. rails-erd also supports limiting the diagram to selected models.
Custom error messages in RSpec or Cucumber steps
RSpec and Cucumber expectations can emit clearer failure messages, making test failures easier to diagnose when matching conditions or subsets of data do not behave as expected.
Heads up: Counting may be slow in PostgreSQL
COUNT queries can be unexpectedly slow in PostgreSQL; any? and none? check for presence or absence without scanning for a full count.
Debugging Capistrano
Capistrano 3’s doctor task checks Ruby, Rubygems and Bundler versions, installed Capistrano gems, config variables and server settings.
Rails 7 adds #caching? and #uncacheable!
Rails 7 fragment caching gets #caching? and #uncacheable! to detect cache context and prevent accidental caching of helpers or partials that must stay dynamic.
Enabling YJIT
Ruby's JIT compiler needs a YJIT-enabled build and explicit activation; Rails 7.2+ enables it after boot, usually making it active already.
Running Rubocop as a pre-push hook
A pre-push Git hook can block pushes when RuboCop finds style or linting issues, and cached runs are much faster after the first check.
DB enums are ordered
PostgreSQL enums keep a defined sort order, unlike string-backed columns whose collation can produce surprising results. Ordered enum values make priority fields behave predictably.
Switching the package manager from yarn to npm
Migrating a Rails app from yarn to npm can reduce dependency complexity and avoids upgrading to Yarn 2.0. Matching package versions helps keep installs stable.
How to eager load a single directory with Zeitwerk
Zeitwerk can eager load a single subdirectory so descendant classes are available for iteration, while avoiding manual require of the parent file.
jeremyevans/ruby-warning: Add custom processing for warnings
ruby-warning customizes Ruby warning handling, letting specific messages or paths be ignored, warnings turned into errors, backtraces attached, and duplicates removed.
CSS: Matching against attributes and their values (or parts of them)
CSS attribute selectors can target partial values, letting links, classes, and other attributes be styled by prefixes, suffixes, substrings, or whitespace-separated tokens.
JavaScript: Calling a function with a variable number of arguments
Passing an array as separate arguments avoids treating the whole array as a single value; ES6 ... and ES5 apply spread elements into a function call.