Rails plugin to marshal and unmarshal fields to the db
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
spec
.gitignore
GPL-LICENSE
MIT-LICENSE
README.rdoc
Rakefile
init.rb

README.rdoc

MarshalField

Installation

Install it in vendor/plugins:

<braid add / git clone / git submodule> \
  git://github.com/smtlaissezfaire/marshal_field.git \
  vendor/plugins/marshal_field

Usage

  • Add a text field to your table:

    add_column :my_table, :marshalled_foo, :text
  • Add the marshal_field declaration:

    Class User < ActiveRecord::Base
      marshal_field :my_field, :marshalled_foo
    end
  • Use the accessor like a typical accessor:

    user = User.new
    user.my_field = [1,2,3]
    user.my_field #=> [1,2,3]

Credits

Copyright © 2009 by Scott Taylor scott@railsnewbie.com

Sponsored by Eastmedia http://eastmedia.com

License

Dual licensed under the MIT & GPL licenses.