Skip to content
This repository has been archived by the owner on Sep 25, 2020. It is now read-only.

fnando/marshaled_attributes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Marshaled Attributes

Save marshaled objects using ActiveRecord.

Instalation

gem install marshaled_attributes

Usage

Considering the following schema:

create_table :pages do |t|
  t.string 	:name
  t.text 	:body
  t.binary 	:meta
end

Add the method call marshaled to your model.

class Page < ActiveRecord::Base
  marshaled :meta
end

@page = Page.new(:meta => {:last_comment_id => 100})
@page.meta
#=> {:last_comment_id => 100}

Copyright © 2008 Nando Vieira, released under the MIT license

About

A simple plugin for saving marshaled objects using ActiveRecord.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages