dblock/mongoid-cached-json — pull request #3 by dblock (2012-02-29 16:34:13+00:00)
Title: Added versioning (inline scheme)

You can specify the field version inline.

``` ruby

class Person
include Mongoid::Document
include Mongoid::CachedJson

field :first
field :last

def name
[ first, middle, last ].compact.join(" ")
end

json_fields \
:first => { :versions => [ :v2, :v3 ] },
:last => { :versions => [ :v2, :v3 ] },
:middle => { :versions => [ :v2, :v3 ] },
:born => { :versions => :v3 },
:name => { :definition => :name }

end
```

The only limitation that I see is that you cannot change the definition of a field between versions.