Ruby Icon

Rails 3.2 RC1 released, now with Active Record Store

logged by @logbot 2011-12-20T16:18:21Z permalink #ruby #rails

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 = 'black', homepage: '')
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