Has Details plugin

Plugin details

HasDetails allows you to store a large amount of (optional) attributes for any model's instance in a serialized column.
It takes care of adding convenience methods to your model, and verifies that the value being assigned is indeed (one of) the type(s) required for that attribute.

Websitehttp://github.com/marten/has_details/tree/master Repositorygit://github.com/marten/has_details.git Author Marten Veldthuis Tags attribute LicenseMIT

Documentation

Install the plugin:
ruby script/plugin install git://github.com/marten/has_details.git

Example
============

  class User << ActiveRecord::Base
    has_details :firstname => String,
                :lastname => String,
                :birthday => Date,
                :gender => [:male, :female]
  end
  
  john = User.find(1)
  john.birthday = 5.years.ago
  john.gender
  => :male

Further Documentation

There is currently no advanced documentation for this plugin.

New documentation

Edit plugin | (0 older versions) | Last edited by: hardway, 6 months ago