Ruby on Rails » Keeping Up With The Joneses: Keeping Rails and its extensions up to date » Pathfinder Development

There are many wonderful things about Rails and the Rails ecosystem. A clean, well-lighted path for keeping all your extensions up to date is not one of them.

Fixing "uninitialized constant ActiveSupport::Dependencies::Mutex (NameError)"

RubyGems 1.6.0 can break Rails 2.x with ActiveSupport::Dependencies::Mutex NameError during startup; loading thread before boot.rb prevents the failure.

Inspecting model callback chains

Rails models expose callback chains for save events, making it possible to inspect registered before and after methods and identify method names.

Refile: Ruby file uploads, take 3

Refile is a Rails gem for file uploads with better direct-to-S3 support than CarrierWave, but on-demand image rendering can increase server load and require caching or a CDN.

Look up a gem's version history

Check a gem’s release history to find newer compatible versions, especially when you need a Rails 2 variant of an installed library.

rack-mini-profiler - the Secret Weapon of Ruby and Rails Speed

rack-mini-profiler helps spot slow Rack and Rails requests by measuring SQL queries, memory allocation, and CPU time.

6 front-end techniques for Rails developers. Part I: From big ball of mud to separated concerns

Untangling JavaScript spaghetti in Rails front ends by splitting responsibilities into separate layers without a JavaScript framework.

Rails 4 drops support for the :assets group in Gemfile

Rails 4 no longer needs the :assets Gemfile group because production no longer triggers unwanted on-demand asset compilation.

Rails, callbacks, workers, and the race you never expected to lose « Logical Friday

Delayed background jobs can run before a Rails record is committed, causing after_save logic to see unsaved state and fail unexpectedly.

Updated: Saving without callbacks in Rails 3

Rails 3 can now save records without running callbacks, reducing side effects when callbacks should be bypassed.

Failtale

Exception tracking service for any platform with a Rails notifier and REST API, useful as a free alternative to Hoptoad/Airbrake for custom error reporting.

Fixing flaky E2E tests

E2E tests often fail from race conditions between browser, app and test code; stabilizing them means synchronizing actions, retries and animations.

Migrate or revert only some migrations

Selective Rails migrations can be moved up, down, redone, or targeted by version instead of processing the full sequence.

Best practice: How to manage versions in a Gemfile

Gem version pins in Gemfile are usually unnecessary because Gemfile.lock fixes installed versions; use constraints only for lockfile-free setups, known regressions, or blocked upgrades.

Shoulda Matchers: how to test conditional validations

Conditional Rails validations with if: are not covered by Shoulda Matchers; test the model’s behavior by stubbing the predicate and checking presence only when it applies.

Best practices: Large data migrations from legacy systems

Large legacy data migrations need deep source-system understanding, fast failure, dedicated logging, and traceable migration metadata to keep long-running imports debuggable and verifiable.

Fix AssociationTypeMismatch

Rails AssociationTypeMismatch errors often come from selecting an associated object instead of its ID in a form field.

Rails 3/4: How to add routes for specs only

Test-only routes can help verify redirects and other edge cases without changing the normal route set. with_routing replaces existing routes, so evaluating a route block keeps both sets available.

JSONP for Rails

JSON responses can be reused in legacy cross-domain requests by wrapping them in a callback function. rack-contrib provides a JSONP middleware for Rails apps.

Updated: Test a gem in multiple versions of Rails

Testing a gem across Rails versions is easier with shared app code and specs via symlinks, keeping one test setup aligned with current best practice.

query_diet now support Rails 3

query_diet now works with Rails 3, with installation differing slightly from older versions.

Ruby, Ruby on Rails, and _why: The disappearance of one of the world’s most beloved computer programmers

A profile of _why and his influence on Ruby and Ruby on Rails, with a personal angle that makes programming culture approachable for nontechnical readers.

RubyMine: Accessing views and partials from controllers

RubyMine links controller methods to their views and partials through gutter icons, making navigation between Rails controllers and templates faster.

Why a Rails flash message is shown twice

Flash messages can appear twice when render is used instead of redirect_to; flash.now is for the current request, flash[] for the next one.