Menu Sidebar
Menu

activerecord

New maintainer needed for NullDB

NullDB, for those who don’t know, is a null backend for ActiveRecord. Unlike RSpec’s stub_object, rather than raise an exception on DB access, will NullDB DB interactions simply become no-ops. This is handy for things like testing after_save hooks in isolation. Myron Marston has done a stellar job shepherding it through the Rails 3 transition, but […]

Fowler on Rails

Projects using Ruby on Rails often lack strong distinctions in two main areas: The model/record conflation: Seeing “models” as strictly DB-backed resources. The view/template conflation: failing to draw a line between view objects and HTML templates. The conflations are encouraged by Rails’ design decisions. When choosing which enterprise design patterns to translate into code, the […]

ActiveRecord Golf

So I was messing around with some scratchpad code today, investigating the use of with_exclusive_scope, and here’s what I had to write to come up with a minimal working ActiveRecord model:

For little one-off demo scripts that seems a bit excessive to me. For comparison, here’s the equivalent DataMapper:

Can anyone golf the […]

Older Posts

Virtuous Code

"The three virtues of a programmer: laziness, impatience, and hubris" — Larry Wall

Books and Screencasts

RubyTapas Screencasts

RubyTapas Screencasts

Small plates of gourmet Ruby code.

Confident Ruby

Confident Ruby cover

32 Patterns for joyful coding.

The Making of Cowsays.com

Confident Ruby cover

Watch me build an app in Sinatra and Rails

Objects on Rails

Objects on Rails

A developer notebook on applying classic Object-Oriented principles to Ruby on Rails projects.

Exceptional Ruby

Exceptional Ruby

The definitive guide to exceptions and failure handling in Ruby.

Archives

Categories