Documenting your project's Node.js version in .nvmrc
Node.js compatibility depends on the exact runtime version, and projects can pin a supported release in .nvmrc so teams use the same setup.
How to set up database_cleaner for Rails with Cucumber and RSpec
Reliable test isolation for Rails with Cucumber and RSpec requires cleaning the test database up front and switching strategies for JavaScript-driven examples.
Your database tables should probably have timestamps
Missing created_at and updated_at columns make record history harder to trace and bug reports harder to investigate. Rails migrations can add and backfill timestamps for old tables.
How to use Simplecov to find untested code in a Rails project with RSpec and Cucumber
Code coverage reveals untested Rails paths and blind spots across RSpec, Cucumber, and parallel test runs. SimpleCov can separate reports and add branch coverage.
Rails 7.1: Take care of the new production log default to standard out
Rails 7.1 changes production logging to standard out, which can break file-based logs in opscomplete setups unless the previous logger configuration is restored.
Zeitwerk: How to collapse folders in Rails
Rails can keep subfolders for organization without turning them into namespaces; collapse lets nested files define top-level constants instead of modules.
Rails: Overriding view templates under certain conditions only
Use request-specific view paths to swap in alternate templates for selected conditions, with fallback to the default templates when no override exists.
Configuring ActionMailer host and protocol for URL generation
ActionMailer URL generation fails without a configured host and protocol. Rails can use hardcoded defaults or derive them from the request for mailers sent outside the request cycle.
Customizing Rails error messages for models and attributes
Rails error messages can be overridden at application, model, or attribute scope through locale YAML files, enabling clearer validation feedback than the default generic texts.
Rails: Reporting CSP Violations to a log file
Capture CSP violation reports in a log file to spot blocked resources and browser-extension noise, with a dedicated Rails endpoint for incoming reports.
Rails: Using PostgreSQL full-text search without a gem
PostgreSQL can handle full-text search in Rails without extra gems, with cached vectors, ranking, weighting, and stemming for faster, more flexible message search.
Understanding race conditions with duplicate unique keys in Rails
validates_uniqueness_of can still allow duplicate records under concurrent requests; a unique database constraint prevents the race and turns collisions into ActiveRecord::RecordNotUnique.
Using rack-mini-profiler (with Unpoly)
Rails performance debugging often hides slow SQL, view rendering, and N+1 queries; rack-mini-profiler helps surface bottlenecks during development.
Rails asset pipeline: Using ESNext without a transpiler
Modern browsers run most ES6 features natively, but Rails asset pipelines can still fail when Uglifier cannot minify newer syntax.
Rails: Composing an ETag from multiple records
fresh_when can combine multiple records into one ETag so associated data keeps cached pages invalidated when any rendered record changes.
Working with or without time zones in Rails applications
Rails time handling is error-prone because Time.now and Time.current can differ. A single-time-zone setup needs matching Active Record and time zone configuration.
Rails I18n fallback locales
Reuse one locale as a fallback for another instead of duplicating translations for regional variants like Austrian German.
Lightning Talk: Coverage based Test Case Prioritization in Ruby on Rails
CLI test case prioritization for Ruby on Rails using coverage data can surface failing specs earlier and reduce regression testing time.
Rails: Configuring the default sorting behaviour
Default ordering in ActiveRecord queries falls back to id unless implicit_order_column is set, which can make first and other finder calls return a different record order.
Rails: Reverse Lookup a Fixture Name by it's id and table name
Find a Rails fixture name from a table and numeric id when the record label is unknown. ActiveRecord::FixtureSet can search loaded fixtures and return the matching key.
Rails: Fixing the memory leak / performance issues in prepend_view_path
prepend_view_path can leak memory and bypass template caching when called per request, causing slower rendering in multi-tenant Rails apps.
Action Mailer Previews
Previewing Rails emails in the browser catches layout and content issues before delivery and helps keep mailer output aligned with expectations.
ActiveRecord: Passing an empty array into NOT IN will return no records
Empty exclusion lists in NOT IN conditions can silently return no rows; where.not in Rails 4+ handles empty arrays safely.
Rails: Keeping structure.sql stable between developers
db/structure.sql can vary between developers because database or CLI tool versions differ, creating noisy diffs and merge conflicts in Rails projects.