title: Rails multiple belongs_to assignment
body: <p>Given </p>
  
  <p>User:</p>
  
  <pre><code>class User &lt; ActiveRecord::Base
     has_many :discussions
     has_many :posts
  end
  </code></pre>
  
  <p>Discussions:</p>
  
  <pre><code>class Discussion &lt; ActiveRecord::Base
      belongs_to :user
      has_many :posts
  end
  </code></pre>
  
  <p>Posts:</p>
  
  <pre><code>class Post &lt; ActiveRecord::Base
      belongs_to :user
      belongs_to :discussion 
  end
  </code></pre>
  
  <p>I am currently initializing Posts in the controller via </p>
  
  <pre><code>@post = current_user.posts.build(params[:post])
  </code></pre>
  
  <p>My question is, how do I set/save/edit the @post model such that the relationship between the post and the discussion is also set?</p>