<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/action_view.rb</filename>
    </added>
    <added>
      <filename>lib/active_record.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,4 +1,60 @@
-AttrLocked
-==========
+== AttrLocked
 
-Description goes here
\ No newline at end of file
++AttrLocked+ is a tiny little Rails plugin that provides extra security for your +ActiveRecord+ models. It lets you specify, at the model level, that certain model attributes should never be allowed to change. Perfect for usernames or financial record-keeping.
+
+
+=== In the model
+
+Let's take an example: your application has users, who each have a username. Once created, that username should never change. +AttrLocked+ lets you specify this with a single line:
+
+  class User &lt; ActiveRecord::Base
+    attr_locked :username
+  end
+
+Now, when you create a new +User+, you can of course assign it a username. But once the record has been saved (specifically, when &lt;tt&gt;new_record?&lt;/tt&gt; returns false) you cannot reassign it. This is best illustrated with a little code:
+
+  foo = User.new(:username =&gt; 'Bob')
+  foo.save
+  
+  bob = User.find_by_username('Bob')
+  bob.username
+  #=&gt; &quot;Bob&quot;
+  bob.username = 'Mike'
+  #=&gt; &quot;Mike&quot;
+  bob.username
+  #=&gt; &quot;Bob&quot;
+  
+  bob.update_attribute(:username, 'Freddie')
+  #=&gt; false
+  bob.username
+  #=&gt; &quot;Bob&quot;
+
+So, you are unable to assign using &lt;tt&gt;username=&lt;/tt&gt; (or indeed using &lt;tt&gt;attributes=&lt;/tt&gt;). +save+, +update_attributes+ and &lt;tt&gt;attributes=&lt;/tt&gt; will silently ignore the locked attributes, just as they do for +attr_protected+. +update_attribute+ will return +false+ if you use it with a locked attribute.
+
+
+=== In the view
+
+To make sure people don't waste their time filling out forms, any form input that's linked to a locked attribute will be disabled automatically, unless you're creating a new record. So, you don't need to go around putting &lt;tt&gt;:disabled =&gt; !object.new_record?&lt;/tt&gt; everywhere. Helpful, no?
+
+
+=== License
+
+Copyright (c) 2007 James Coglan
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the &quot;Software&quot;),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.</diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -1 +1,2 @@
-require File.dirname(__FILE__) + '/lib/attr_locked'
+require File.dirname(__FILE__) + '/lib/active_record'
+require File.dirname(__FILE__) + '/lib/action_view'</diff>
      <filename>init.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>lib/attr_locked.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>e529f2496a55854943fda258c5dba33e12951627</id>
    </parent>
  </parents>
  <author>
    <name>James Coglan</name>
    <email>jcoglan@googlemail.com</email>
  </author>
  <url>http://github.com/jcoglan/attr_locked/commit/6b6f33cca868598b8e1c9ecba98a881241cfd943</url>
  <id>6b6f33cca868598b8e1c9ecba98a881241cfd943</id>
  <committed-date>2007-06-08T09:54:13-07:00</committed-date>
  <authored-date>2007-06-08T09:54:13-07:00</authored-date>
  <message>Added InstanceTag modifications and README. Now locked attributes have their form inputs disabled for updating.</message>
  <tree>c3d93c4f17247a411d34e11b64a8da8749a8499e</tree>
  <committer>
    <name>James Coglan</name>
    <email>jcoglan@googlemail.com</email>
  </committer>
</commit>
