Rails 3.2 RC1 released, now with Active Record Store

Wynn Netherland Wynn Netherland

The Rails team has released a release candidate for Rails 3.2, the last major version supporting Ruby 1.8.7:

Among the list of changes, the Active Record Store caught my eye:

class User < ActiveRecord::Base
  store :settings, accessors: [ :color, :homepage ]
u = User.new(color: 'black', homepage: '37signals.com')
u.color                          # Accessor stored attribute
u.settings[:country] = 'Denmark' # Any attribute, even if not specified with an accessor

I’ve long used Rails Settings in many projects. It’ll be nice to have this baked in.

0:00 / 0:00