Capistrano + Rails: Automatically skipping asset compilation when assets have not changed

Rails deployments can spend minutes precompiling assets; Capistrano can skip that work automatically when the code and asset files have not changed.

How to: Use git bisect to find bugs and regressions

Binary search through commits isolates the first bad revision that introduced a bug or regression, with git bisect and optional automated tests.

Regular tasks for long-running projects

Long-running projects need regular upkeep to avoid stale dependencies, growing data, and bloated storage that raise costs and slow applications.

GoodJob: Ensure you get notified about background exceptions

ActiveJob and GoodJob can swallow exceptions, causing silent background job failures. Subscribing to job events and on_thread_error restores exception notifications and adds failure context.

How to query GraphQL APIs with Ruby

GraphQL APIs return nested data through one endpoint, and Ruby can query or mutate them with plain HTTP requests without adding graphql-client.

Minifying object properties in JavaScript files

JavaScript minifiers can shorten private members safely when internal names follow _ or # conventions, reducing bundle size without mangling public APIs.

better rails app restart with the passenger restart-app tool

passenger-config restart-app restarts a Rails app immediately without touching tmp/restart.txt, avoiding the next-request delay and fitting Capistrano deployments.

Take care of indentation and blank lines when using .erb for plain text emails

Plain text .erb emails preserve indentation and blank lines, so indented template code can insert unwanted spaces or extra newlines. Trim mode and unindented markup prevent formatting bugs.

Making minimal updates to DOM trees using morphdom / idiomorph

Replacing DOM fragments with innerHTML wipes state such as form values, scroll position, and custom-element data. morphdom and idiomorph preserve existing nodes by applying minimal changes.

Ruby: How to collect a Hash from an Array

Map an array or enumerable to a hash in Ruby using to_h, index_by, group_by, index_with, or a custom collect_hash helper.

How to: Benchmark an Active Record query with a Ruby script

Benchmarking Active Record queries needs repeated runs and cache clearing to measure realistic PostgreSQL performance; a Ruby script can report percentile timings.

Consider adding Reek to your CI pipeline

Reek detects Ruby code smells and antipatterns, helping assess merge request quality without blocking every warning. It fits CI as a non-blocking lint check.

PSA: Chrome and Firefox do not always clear session cookies on exit

Chrome and Firefox can retain session cookies on exit when reopening tabs from the last session, so browser shutdown does not always end cookie lifetime.

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.

Rails: Configure ActionController to raise when strong params are invalid

Raise controller errors for unexpected request parameters in Rails APIs, letting invalid payloads surface as ActionController::UnpermittedParameters and ActionController::ParameterMissing.

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.

Fixing authentication in legacy applications

Legacy authentication setups often miss SSL, cookie, CSRF, and session-fixation protections, leaving logins and browser-stored data easy to compromise.

Case sensitivity in PostgreSQL

PostgreSQL compares strings case-sensitively, which can break email and username lookups and uniqueness checks. Lowercasing values or using case-insensitive matching avoids common bugs.

has_one association may silently drop associated record when it is invalid

has_one autosave can drop an invalid associated record without failing the parent save, leaving the parent persisted and the child unsaved.

JSON APIs: Default design for common features

JSON API design benefits from established conventions for attributes, pagination, errors, and related objects, making client integration more predictable.

Enabling view rendering for controller specs

Controller specs usually skip template rendering; integrate_views in RSpec 1 or render_views in RSpec 2 enables view rendering for specs that need it.

Choosing the right gems for your project

External libraries add maintenance and security risk, so picking a Ruby gem needs attention to necessity, test quality, license, maturity, and scope fit.

Using a virtual column for trigram indexes in PostgreSQL

Trigram indexes provide a lightweight alternative when full-text search becomes too rigid or slow. A virtual column can combine multiple text fields and support indexed LIKE queries.

Capistrano 3: Running a command on all servers

Capistrano 3 can execute an arbitrary shell command across all app servers, useful for grepping logs or bulk remote checks.