title: How do I add associations between tables using rails generate model
body: <p>The title says it all really. It seems to me that rails generate model mystuff
  will generate a model which is empty apart from</p>
  
  <pre><code>class mystuff &lt; ActiveRecord::Base
  end
  </code></pre>
  
  <p>It also generates a migration file which I can send to the database with </p>
  
  <pre><code>rake db:migrate
  </code></pre>
  
  <p>which is great until I want to throw in a has_many relationship. In this case I go back to the model so that it looks like for example:</p>
  
  <pre><code> class mystuff &lt; ActiveRecord::Base
      has_many :posts
      end
  </code></pre>
  
  <p>Then I run <code>rake db:migrate</code> again but because the migration file hasn't been updated nothing interesting happens.</p>
  
  <p>So then I run </p>
  
  <pre><code>rails generate migration mystuff and the migration file appears. 
  </code></pre>
  
  <p>Great. Now I want to update the database itself so I run <code>rake db:migrate</code> again and the schema updates. All of this is a bit wordy so is there a way I can just generate all the associations when I'm generating the model. That would be easier</p>