title: Not able to make relationship correctly the rails way or a polymorphic relation ship?
body: <p>I am using rails 5 and Ruby 2.3<br>
  I have a model name User created using the devise which can create jobs so the migration used for this is: </p>
  
  <pre><code>rails g model job user:references cader_id:integer
  </code></pre>
  
  <p>These jobs can be completed by the other user's with role Cader. When a Cader completed a job In it I store the user_id of that user in the job table as cader_id which is integer</p>
  
  <p>What should be the correct way of doing it in the rails with proper indexing. So In case I want to search  all jobs completed by the user they get searched fast the indexing.</p>
  
  <p>I can search all jobs created by that user like</p>
  
  <pre><code>user.jobs
  </code></pre>
  
  <p>similarly to search the user of a particular job that can be searched using </p>
  
  <pre><code>job.user
  </code></pre>
  
  <p>How can, I search all jobs completed by the user as user as Cader
  like </p>
  
  <pre><code>cader.completed_jobs or user.completed_job 
  </code></pre>
  
  <p>and to search for the particular Cader who completed the job like</p>
  
  <pre><code>job.cader
  </code></pre>
  
  <p>Thank in advance  </p>
  
  <p>for now to search Cader that completed a Particular job I have written the class method like </p>
  
  <pre><code> def cader?
      cader = User.find(self.cader_id)
   end     
  </code></pre>