title: Rails Associations Planning
body: <p>I'm still making my way with Rails and I have a question about associations.</p>
  
  <p>I'm building a fitness website and I want to have users track their workouts. I'm a bit unsure as to how the associations should go. What follows is what I currently have.</p>
  
  <p>A Workout is made up of a group of exercises. The user would create a workout object to save all the exercises together so as to not have to repeat the creation process every time. On top of that I don't want them to have to re-create exercises to add it to a new workout. So, both workouts and exercises would belong to a user.</p>
  
  <p>My planned associations are this.</p>
  
  <pre><code>Workout
  belongs_to :user
  has_many :exercises, :through =&gt; :routines
  
  Exercise
  belongs_to :user
  has_many :workouts, :through =&gt; :routines
  
  Routines
  belongs_to :workout
  belongs_to :exercise
  
  User
  has_many :workouts
  has_many :exercises
  //the rest of the user associations
  </code></pre>
  
  <p>I think this is correct, but having both workout and exercise belonging to the user seems somewhat redundant to me. Is this the best setup or is there another way to associate these things? Any help is appreciated.</p>