by Cardinal Blue ( cardinalblue.com )
Serialize out of the Cerealize Box * a drop-in replacement for ActiveRecord's serialize It can auto transcode old encoding (yaml if you're using AR's serialize), to new encoding (marshal, json, you name it) without any migration. Current supported encoding: 1. YAML 2. Marshal 3. JSON (planned) Current supported ORM: 1. ActiveRecord (tested with 2.3.5) 2. DataMapper (planned)
require 'cerealize' class User < ActiveRecord::Base # when force_encoding set to false (this is default), cerealize is # smart enough to transcode old encoding (e.g. yaml) to new encoding # (i.e. marshal) cerealize :data, Hash, :encoding => :marshal, :force_encoding => false end
tested with MRI 1.8.7 and 1.9.1
one of your desired ORM
> gem install cerealize # or if you want rails plugin and bleeding edge > script/plugin install git://github.com/cardinalblue/cerealize.git
Apache License 2.0 Copyright (c) 2010, Cardinal Blue Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Generated with the Darkfish Rdoc Generator 1.1.6.