<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Ruby on Rails :: Restful friends with has_many :through</title>
	<atom:link href="http://dnite.wordpress.com/2006/11/25/ruby-on-rails-restful-friends-with-has_many-through/feed/" rel="self" type="application/rss+xml" />
	<link>http://dnite.wordpress.com/2006/11/25/ruby-on-rails-restful-friends-with-has_many-through/</link>
	<description>For my new blog, head over to http://blog.dnite.org</description>
	<lastBuildDate>Sun, 10 Feb 2008 22:21:56 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Eamon Ford</title>
		<link>http://dnite.wordpress.com/2006/11/25/ruby-on-rails-restful-friends-with-has_many-through/#comment-349</link>
		<dc:creator>Eamon Ford</dc:creator>
		<pubDate>Fri, 26 Jan 2007 22:32:23 +0000</pubDate>
		<guid isPermaLink="false">http://dnite.wordpress.com/2006/11/25/ruby-on-rails-restful-friends-with-has_many-through/#comment-349</guid>
		<description>I eagerly await the plugin! :)</description>
		<content:encoded><![CDATA[<p>I eagerly await the plugin! <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dnite</title>
		<link>http://dnite.wordpress.com/2006/11/25/ruby-on-rails-restful-friends-with-has_many-through/#comment-30</link>
		<dc:creator>dnite</dc:creator>
		<pubDate>Thu, 30 Nov 2006 19:04:56 +0000</pubDate>
		<guid isPermaLink="false">http://dnite.wordpress.com/2006/11/25/ruby-on-rails-restful-friends-with-has_many-through/#comment-30</guid>
		<description>ya, everyone&#039;s just catching all my mistakes here. indeed, i meant User.find(1).friends &lt;&lt; another_user</description>
		<content:encoded><![CDATA[<p>ya, everyone&#8217;s just catching all my mistakes here. indeed, i meant User.find(1).friends &lt;&lt; another_user</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zeno</title>
		<link>http://dnite.wordpress.com/2006/11/25/ruby-on-rails-restful-friends-with-has_many-through/#comment-29</link>
		<dc:creator>zeno</dc:creator>
		<pubDate>Thu, 30 Nov 2006 14:29:18 +0000</pubDate>
		<guid isPermaLink="false">http://dnite.wordpress.com/2006/11/25/ruby-on-rails-restful-friends-with-has_many-through/#comment-29</guid>
		<description>ok, I got it , by posting the previous comment I understood the problem, 
it&#039;s a wordpress problem, not a RoR one ;-) (needed to use &quot;&amp; l t ;&quot; to write &quot;&lt;&quot;)

so , you should also update the line:

User.find(1).friends

with:

User.find(1).friends &lt;&lt; another_user

(sorry for the &quot;spam&quot;)</description>
		<content:encoded><![CDATA[<p>ok, I got it , by posting the previous comment I understood the problem,<br />
it&#8217;s a wordpress problem, not a RoR one <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  (needed to use &#8220;&amp; l t ;&#8221; to write &#8220;&lt;&#8221;)</p>
<p>so , you should also update the line:</p>
<p>User.find(1).friends</p>
<p>with:</p>
<p>User.find(1).friends &lt;&lt; another_user</p>
<p>(sorry for the &#8220;spam&#8221;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zeno</title>
		<link>http://dnite.wordpress.com/2006/11/25/ruby-on-rails-restful-friends-with-has_many-through/#comment-28</link>
		<dc:creator>zeno</dc:creator>
		<pubDate>Thu, 30 Nov 2006 14:24:55 +0000</pubDate>
		<guid isPermaLink="false">http://dnite.wordpress.com/2006/11/25/ruby-on-rails-restful-friends-with-has_many-through/#comment-28</guid>
		<description>&#039;&lt;&#039;</description>
		<content:encoded><![CDATA[<p>&#8216;&lt;&#8217;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zeno</title>
		<link>http://dnite.wordpress.com/2006/11/25/ruby-on-rails-restful-friends-with-has_many-through/#comment-27</link>
		<dc:creator>zeno</dc:creator>
		<pubDate>Thu, 30 Nov 2006 14:22:44 +0000</pubDate>
		<guid isPermaLink="false">http://dnite.wordpress.com/2006/11/25/ruby-on-rails-restful-friends-with-has_many-through/#comment-27</guid>
		<description>when you say: 
  &quot;But if I try and do something like... User.find(1).friends&quot;
you mean...
  &quot;But if I try and do something like... User.find(1).friends </description>
		<content:encoded><![CDATA[<p>when you say:<br />
  &#8220;But if I try and do something like&#8230; User.find(1).friends&#8221;<br />
you mean&#8230;<br />
  &#8220;But if I try and do something like&#8230; User.find(1).friends</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dnite</title>
		<link>http://dnite.wordpress.com/2006/11/25/ruby-on-rails-restful-friends-with-has_many-through/#comment-26</link>
		<dc:creator>dnite</dc:creator>
		<pubDate>Tue, 28 Nov 2006 22:20:47 +0000</pubDate>
		<guid isPermaLink="false">http://dnite.wordpress.com/2006/11/25/ruby-on-rails-restful-friends-with-has_many-through/#comment-26</guid>
		<description>Much better. Very sorry about that for anyone else who was confused as well. I completely forgot about the &lt; in the class definition and it killed things. Looks better now. Thanks for letting me know.</description>
		<content:encoded><![CDATA[<p>Much better. Very sorry about that for anyone else who was confused as well. I completely forgot about the &lt; in the class definition and it killed things. Looks better now. Thanks for letting me know.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dnite</title>
		<link>http://dnite.wordpress.com/2006/11/25/ruby-on-rails-restful-friends-with-has_many-through/#comment-25</link>
		<dc:creator>dnite</dc:creator>
		<pubDate>Tue, 28 Nov 2006 22:09:00 +0000</pubDate>
		<guid isPermaLink="false">http://dnite.wordpress.com/2006/11/25/ruby-on-rails-restful-friends-with-has_many-through/#comment-25</guid>
		<description>ya, sorry. I missed that one. I&#039;ll fix it. WordPress doesn&#039;t like to be nice to me in code and blockquote&#039;s .. so something went wrong when I pasted that. I shall fix it now, thanks for the heads up.</description>
		<content:encoded><![CDATA[<p>ya, sorry. I missed that one. I&#8217;ll fix it. WordPress doesn&#8217;t like to be nice to me in code and blockquote&#8217;s .. so something went wrong when I pasted that. I shall fix it now, thanks for the heads up.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Evan Farrar</title>
		<link>http://dnite.wordpress.com/2006/11/25/ruby-on-rails-restful-friends-with-has_many-through/#comment-24</link>
		<dc:creator>Evan Farrar</dc:creator>
		<pubDate>Tue, 28 Nov 2006 22:03:06 +0000</pubDate>
		<guid isPermaLink="false">http://dnite.wordpress.com/2006/11/25/ruby-on-rails-restful-friends-with-has_many-through/#comment-24</guid>
		<description>I have no idea what this means. Typo?
&lt;blockquote&gt;class User :friendships&lt;/blockquote&gt;

As for your sql error, your model-defined relations seem a little hard to follow. Maybe you need something like this?
&lt;code&gt;
    class User
      has_many :friends, :through =&gt; &#039;friendships&#039;
    end

    class Friendship
      has_one :user
      has_one :friend, :class_name =&gt; &#039;User&#039;, :foreign_key =&gt; &#039;friend_id&#039;
    end
&lt;/code&gt;
of course, it is always nice to have some sort of validation and/or before_create/before_validation that makes sure if you are someone&#039;s friend that they are also your friend. Or maybe you could walk a fine semantic line by pretending that one-way friendships are indications of an outstanding friend request (then delete the one-way upon rejecting, allowing the requester to later reiterate his request).</description>
		<content:encoded><![CDATA[<p>I have no idea what this means. Typo?</p>
<blockquote><p>class User :friendships</p></blockquote>
<p>As for your sql error, your model-defined relations seem a little hard to follow. Maybe you need something like this?<br />
<code><br />
    class User<br />
      has_many :friends, :through =&gt; 'friendships'<br />
    end</p>
<p>    class Friendship<br />
      has_one :user<br />
      has_one :friend, :class_name =&gt; 'User', :foreign_key =&gt; 'friend_id'<br />
    end<br />
</code><br />
of course, it is always nice to have some sort of validation and/or before_create/before_validation that makes sure if you are someone&#8217;s friend that they are also your friend. Or maybe you could walk a fine semantic line by pretending that one-way friendships are indications of an outstanding friend request (then delete the one-way upon rejecting, allowing the requester to later reiterate his request).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: A quick Friends List guide for Ruby on Rails at There was Code; Then there was AJAX!</title>
		<link>http://dnite.wordpress.com/2006/11/25/ruby-on-rails-restful-friends-with-has_many-through/#comment-17</link>
		<dc:creator>A quick Friends List guide for Ruby on Rails at There was Code; Then there was AJAX!</dc:creator>
		<pubDate>Sun, 26 Nov 2006 08:39:03 +0000</pubDate>
		<guid isPermaLink="false">http://dnite.wordpress.com/2006/11/25/ruby-on-rails-restful-friends-with-has_many-through/#comment-17</guid>
		<description>[...] After having a hard time finding information on putting together a nice self-referential association for a friends list, the author has put together a guide to help out.read more&#160;&#124;&#160;digg story  Share and Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages. [...]</description>
		<content:encoded><![CDATA[<p>[...] After having a hard time finding information on putting together a nice self-referential association for a friends list, the author has put together a guide to help out.read more&nbsp;|&nbsp;digg story  Share and Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages. [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
