Upgrading RubyGems to the last compatible version
Installing the newest RubyGems can break older Ruby versions; use the latest compatible release instead of the default system update.
Rails: Example on how to extract domain independent code from the `app/models` folder to the `lib/` folder
Move API-client code out of app/models into lib/ to separate domain logic from reusable infrastructure and keep Rails code more maintainable.
Ruby: How to make your ruby library configurable
Configuring a Ruby library via a block makes endpoints and similar settings easy to override without hardcoding values.
MySQL will not use indexes if you query the wrong data type
MySQL can ignore indexes when a predicate compares a column to the wrong data type, turning lookups into full table scans.
Rspec: around(:all) and around(:each) hook execution order
RSpec hook order matters when around(:all) and around(:each) wrap setup and teardown; their execution timing differs from before and after hooks.
Ruby: Different ways of assigning multiple attributes
Ruby classes with many fields can become hard to instantiate or validate. Options range from positional and keyword arguments to ActiveModel::Attributes, Struct, hashes, and OpenStruct.
Chrome: disable "Choose your search engine" popup in tests
Fresh Chrome installs in Europe can trigger a search-engine choice popup that breaks Cucumber tests; --disable-search-engine-choice-screen disables it.
cucumber_factory 1.14 lets you set array fields, has_many associations, numbers without quotes
cucumber_factory 1.14 adds array attributes, multiple has_many associations, and unquoted numeric values in factory-style test data.
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.
Load order of the environment
Rails environment code loads in a fixed boot order, affecting which settings and constants can override others. Knowing the initialization sequence prevents surprises when adding configuration or app code.
Beware of params with non-string values (nil, array, hash)
params can contain nil, arrays, or hashes, so treating request values as plain strings can lead to unsafe lookups and unexpected matches.
Ruby blocks: Braces and do/end have different precedence
{} and do ... end bind blocks to different method calls, which can make print names.map do ... end return an Enumerator instead of the mapped array.
Tod: A Gem for handling daytime without a date
Tod handles time-of-day values without dates, avoiding timezone-related bugs when parsing, comparing, formatting, or storing hours, minutes, and seconds.
Capistrano: Configure environment specific array attributes
Capistrano can adjust array-style settings per environment, letting deployments add or remove linked files without duplicating the base configuration.
Rails I18n scope for humanized attribute names
Custom attribute labels in Rails can be stored in locale files and reused by human_attribute_name and error messages instead of duplicating names in code.
Deployment: Merge consecutive commits without cherry-picking
Skip unready commits during deployment by merging an earlier commit reference instead of cherry-picking, avoiding duplicate history entries later.
The Framework Field Guide - Fundamentals | Unicorn Utterances
Frontend rendering fundamentals are often hard to compare across Vue, Angular and React. A side-by-side guide highlights shared component, rendering and state-sharing concepts.
RSpec: Applying stubs only within a block
RSpec mocks normally persist for a spec; RSpec::Mocks.with_temporary_scope limits temporary stubs to a block and releases them afterward.
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.
Modern HTTP Status codes for redirecting
HTTP redirect handling differs for GET and non-GET requests; newer codes preserve or change the method explicitly, avoiding browser-dependent behavior from 301 and 302.
How to list updateable dependencies with Bundler and Yarn
List outdated gems and packages that can be upgraded, with filters for allowed versions and dependency groups to narrow bulk updates.
Caveat when using Rails' new "strict locals" feature
Rails 7.1 strict locals can make unrelated ArgumentErrors look like render-call failures, obscuring the real source of an error in a partial.
How to tell ActiveRecord how to preload associations (either JOINs or separate queries)
ActiveRecord association loading can use separate queries or joins, and includes may switch between them automatically. preload is the safest default for avoiding surprise eager loading behavior.
Async control flow in JavaScript: Promises, Microtasks, async/await
JavaScript async code often becomes hard to read and error-prone; promises and async/await flatten control flow, model failures, and avoid callback nesting.