<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>idlesong (idlesong)</title>
    <link>https://ruby-china.org/idlesong</link>
    <description/>
    <language>en-us</language>
    <item>
      <title>如何实现 Twitter 的 following 功能？</title>
      <description>&lt;p&gt;最近在学习用 Emberjs 写一个 twitter 的 following 功能，类似 rails 中的（www.railstutorial.org/book/following_users）：&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class CreateRelationships &amp;lt; ActiveRecord::Migration
  def change
    create_table :relationships do |t|
      t.integer :follower_id
      t.integer :followed_id

      t.timestamps null: false
    end
    add_index :relationships, :follower_id
    add_index :relationships, :followed_id
    add_index :relationships, [:follower_id, :followed_id], unique: true
  end
end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;但是看了 Ember data 的 常见 association，没有发现什么好的实现的方案，google 了半天也没有什么头绪。请问大家该如何实现，或者有什么资料可以参考？&lt;/p&gt;</description>
      <author>idlesong</author>
      <pubDate>Tue, 07 Apr 2015 14:07:44 +0800</pubDate>
      <link>https://ruby-china.org/topics/25032</link>
      <guid>https://ruby-china.org/topics/25032</guid>
    </item>
  </channel>
</rss>
