Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

With README

  • Loading branch information...
commit b8a78823feafe8a5bf2fd3228edbeea169677d78 1 parent 8da1dd0
@marten authored
Showing with 6 additions and 3 deletions.
  1. +6 −3 README
View
9 README
@@ -1,7 +1,7 @@
HasDetails
==========
-HasDetails
+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.
Example
=======
@@ -10,10 +10,13 @@ class User << ActiveRecord::Base
has_details :firstname => String,
:lastname => String,
:birthday => Date,
- :gender => Symbol
-
+ :gender => [:male, :female]
end
+john = User.find(1)
+john.birthday = 5.years.ago
+john.gender
+=> :male
=======
Copyright (c) 2008 Marten Veldthuis, released under the MIT license
Please sign in to comment.
Something went wrong with that request. Please try again.