title: Active record association in rails 4/5
body: <p>I have the following four models and I need help with how to associate the projects model to the timesheet and task model. The models I have are as follows:</p>
  <pre><code>User
  Timesheet =&gt; has_many :tasks
  Project =&gt; beloings_to :task
  Project =&gt; has_many :tasks
  Task =&gt; belongs_to :timesheet
  Task=&gt; belongs_to :project
  </code></pre>
  <p>When I execute the following association I get a response as shown below;</p>
  <pre><code>User.find(1).time_sheets.find(6).tasks
  </code></pre>
  <blockquote>
  <p>[
  #&lt;Task:0x00007fbdf5419780   id: 15,   description: &quot;Fixed the mat issue&quot;,   task_date: &quot;May 17, 2021&quot;,   hours_worked: 3,   project_id:
  2,   created_at: Mon, 17 May 2021 16:57:28 UTC +00:00,   updated_at:
  Mon, 17 May 2021 16:57:28 UTC +00:00,   time_sheet_id: 6&gt;,
  #&lt;Task:0x00007fbdf54194b0   id: 16,   description: &quot;Built IOS and Android module&quot;,   task_date: &quot;May 17, 2021&quot;,   hours_worked: 3,<br />
  project_id: 5,   created_at: Mon, 17 May 2021 23:41:00 UTC +00:00,<br />
  updated_at: Mon, 17 May 2021 23:41:00 UTC +00:00,   time_sheet_id: 6&gt;,
  ]</p>
  </blockquote>
  <p>How do I associate the project model to the response and be able to be able to get the project_name in the result? Thanks for the help.</p>