title: How to assign a has_many/belongs_to relation properly in Rails ActiveRecord?
body: <p>I have a rails app with articles and author model. If I have an author and a post and want to indicate that the author should be the owner of the article, or that the article belongs to the author, what ist the best practice to do so? In particular:</p>
  
  <p>Does it make a difference if I set</p>
  
  <pre><code>my_article.author_id = author_one.id
  </code></pre>
  
  <p>or If I do </p>
  
  <pre><code>author_one &lt;&lt; my_article
  </code></pre>
  
  <p>The associations that are used are</p>
  
  <ul>
  <li>Author has_many articles </li>
  <li>Articles belongs_to Author</li>
  </ul>
  
  <p>And, by the way, what would be the best way to look it up if similar questions appear? </p>