<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/symbolize.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,13 +1,57 @@
-ActiverecordSymbolize
-=====================
+= Symbolize attribute values in ActiveRecord (e.g. for nicer enums)
 
-Introduction goes here.
+This plugin introduces an easy way to use symbols for values of ActiveRecord
+attributes. Symbolized attributes return a ruby symbol (or nil) as their value
+and can be set using symbols.
 
+== About
 
-Example
-=======
+Since ActiveRecord does not natively support database column types of ENUM or
+SET, you'll usually use a string attribute and restrict it to certain values
+with validations. Using this plugin, the values of such pseudo-enums are
+symbols, which look more ruby-style than strings.
 
-Example goes here.
+Simply add &quot;symbolize :attr_name&quot; to your model class, and the specified
+attribute will return symbol values and can be set using smbols (setting
+string values will still work, which is important when using forms).
+
+An attribute to symbolize should be a string (varchar) column in the database.
+
+Blog: http://zargony.com/
+Github: http://github.com/zargony/activerecord_symbolize
+
+== Install
+
+  ./script/plugin install git://github.com/zargony/activerecord_symbolize.git
+
+== Usage
+
+Add &quot;symbolize :attr_name&quot; to your model class. You may also want to add
+validates_inclusion_of to restrict the possible values (just like an enum).
+
+  class User &lt; ActiveRecord::Base
+    symbolize :gender
+    validates_inclusion_of :gender, :in =&gt; [:female, :male]
+  end
+
+== Examples
+
+  u = User.find_by_name('Anna')   # =&gt; #&lt;User Anna&gt;
+  u.gender                        # =&gt; :female
+  
+  u = User.find_by_gender(:male)  # =&gt; #&lt;User Bob&gt;
+  u.gender                        # =&gt; :male
+  
+  u = User.find(:all, :conditions =&gt; { :gender =&gt; :female })
+  
+  u = User.new(:name =&gt; 'ET', :gender =&gt; :unknown)
+  u.save                          # =&gt; validation fails
+
+== Notes
+
+I've been using this for quite some time and made it a rails plugin now. More
+background iinformation can be found at
+http://zargony.com/2007/09/07/symbolize-attribute-values-in-activerecord
 
 
 Copyright (c) 2007-2008 Andreas Neuhaus, released under the MIT license</diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -1 +1 @@
-# Include hook code here
+ActiveRecord::Base.send(:include, Symbolize)</diff>
      <filename>init.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>lib/activerecord_symbolize.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>9eb834b9ad02b3d9cbe6b1d97bdfe657789fe13c</id>
    </parent>
  </parents>
  <author>
    <name>Andreas Neuhaus</name>
    <email>zargony@zargony.com</email>
  </author>
  <url>http://github.com/zargony/activerecord_symbolize/commit/6213779989f2cc5c344addca4953877b1178fe1f</url>
  <id>6213779989f2cc5c344addca4953877b1178fe1f</id>
  <committed-date>2008-04-16T09:28:13-07:00</committed-date>
  <authored-date>2008-04-16T09:28:13-07:00</authored-date>
  <message>Added code from http://zargony.com/2007/09/07/symbolize-attribute-values-in-activerecord to this plugin and created a README</message>
  <tree>50a62b0105cda614082e697e7b915ac5b58ef94a</tree>
  <committer>
    <name>Andreas Neuhaus</name>
    <email>zargony@zargony.com</email>
  </committer>
</commit>
