<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>app/models/user_comment.rb</filename>
    </added>
    <added>
      <filename>db/migrate/015_create_user_comments.rb</filename>
    </added>
    <added>
      <filename>test/fixtures/user_comments.yml</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -63,4 +63,12 @@ class UsersController &lt; ApplicationController
 																	 extra_terms
 		end
 	end
+
+	def comments
+		@user = User.find_by_login(params[:id])
+
+		@user.comments.create :author_id =&gt; current_user.id, :text =&gt; params[:text], :created =&gt; Time.now
+
+		redirect_to :action =&gt; :show
+	end
 end</diff>
      <filename>app/controllers/users_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -61,6 +61,8 @@ class User &lt; ActiveRecord::Base
 	has_many :borrowed, :class_name =&gt; 'Item', :through =&gt; :borrowings,
 		:source =&gt; :item, :conditions =&gt; &quot;status = 'lent'&quot;
 
+	has_many :comments, :class_name =&gt; 'UserComment'
+
 	# gets all the tags this user has used and how many times they've used them
 	# sorted with most occurances first
 	def tag_counts</diff>
      <filename>app/models/user.rb</filename>
    </modified>
    <modified>
      <diff>@@ -15,6 +15,30 @@
 &lt;/table&gt;
 &lt;% end %&gt;
 
+&lt;% if current_user or not @user.comments.empty? %&gt;
+	&lt;h2&gt;Comments&lt;/h2&gt;
+&lt;% end %&gt;
+
+&lt;% unless @user.comments.empty? %&gt;
+	&lt;% @user.comments.each do |c| %&gt;
+		&lt;div class=&quot;comment&quot; style=&quot;margin-bottom: 1em;&quot;&gt;
+			&lt;p&gt;&lt;%= paragraphize c.text %&gt;&lt;/p&gt;
+			&lt;p class=&quot;byline&quot;&gt;-- &lt;%= user_link(c.author) %&gt; &lt;%= c.created.strftime(&quot;%Y-%m-%d&quot;) %&gt;&lt;/p&gt;
+		&lt;/div&gt;
+	&lt;% end %&gt;
+&lt;% end %&gt;
+
+&lt;% if current_user %&gt;
+	&lt;% form_tag comments_user_path(@user.login), :method =&gt; 'post' do %&gt;
+		&lt;label style=&quot;vertical-align: top&quot;&gt;Write a comment:
+			&lt;textarea name=&quot;text&quot; rows=&quot;7&quot; cols=&quot;30&quot; &gt;&lt;/textarea&gt;
+		&lt;/label&gt;&lt;br&gt;
+		&lt;input type=&quot;submit&quot; value=&quot;Comment&quot; style=&quot;margin-left: 3em; margin-top: 1em;&quot;&gt;
+	&lt;% end %&gt;
+&lt;% end %&gt;
+
+&lt;h2&gt;Items&lt;/h2&gt;
+
 &lt;% if @items.empty? %&gt;
 	&lt;p&gt;This user hasn't listed any items yet.&lt;/p&gt;
 &lt;% else %&gt;</diff>
      <filename>app/views/users/show.rhtml</filename>
    </modified>
    <modified>
      <diff>@@ -8,7 +8,7 @@ ActionController::Routing::Routes.draw do |map|
   map.resources :videos, :collection =&gt; { :search =&gt; :get }
 
   map.connect 'users/:id/search', :controller =&gt; 'users', :action =&gt; 'search'
-  map.resources :users, :requirements =&gt; { :id =&gt; %r([^/;,?]+) }
+  map.resources :users, :requirements =&gt; { :id =&gt; %r([^/;,?]+) }, :member =&gt; { :comments =&gt; :post }
 
   map.resources :loans
 </diff>
      <filename>config/routes.rb</filename>
    </modified>
    <modified>
      <diff>@@ -388,3 +388,11 @@ display:none;
 .fieldWithErrors input {
 	background: #d99;
 }
+
+.comment {
+	margin-bottom: 1em;
+}
+
+.comment .byline {
+	padding-left: 2em;
+}</diff>
      <filename>public/stylesheets/andreas06.css</filename>
    </modified>
    <modified>
      <diff>@@ -29,4 +29,12 @@ class UsersControllerTest &lt; ActionController::TestCase
 
 		assert_match /Homage to Catalonia/, @response.body
 	end
+
+	def test_show_comments
+		get :show, :id =&gt; 'medwards'
+
+		assert_response :success
+
+		assert_match /A Rad Dude./, @response.body
+	end
 end</diff>
      <filename>test/functional/users_controller_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>9da79015bd504de8fe9a96e6b93800c90a704019</id>
    </parent>
  </parents>
  <author>
    <name>Brendan Taylor</name>
    <email>whateley@gmail.com</email>
  </author>
  <url>http://github.com/medwards/free-library-on-rails/commit/a56a2ea40ae58e107db01fcd5b78f015f808539f</url>
  <id>a56a2ea40ae58e107db01fcd5b78f015f808539f</id>
  <committed-date>2009-10-03T18:41:30-07:00</committed-date>
  <authored-date>2009-10-03T18:41:30-07:00</authored-date>
  <message>add user comments</message>
  <tree>ffc757dfd55675ed45a29936757c5a9b98fd9dd7</tree>
  <committer>
    <name>Brendan Taylor</name>
    <email>whateley@gmail.com</email>
  </committer>
</commit>
