title: ActiveRecord select distinct records having 3 columns in account
body: <p>In the following scenario:</p>
  
  <p><code>ClassHour (teacher_id, room_id, hour_id, group_id, subject_id)</code></p>
  
  <p>I need to obtain all the class_hours of a given teacher without having the group_id in account. </p>
  
  <pre><code>id    teacher_id    room_id    hour_id    group_id    subject_id
  1         1            1          1          1            1
  2         1            1          1          2            1
  3         1            2          2          1            1
  4         2            1          3          2            3
  </code></pre>
  
  <p>I need to obtain only <code>unique records on room_id, hour_id and subject_id</code> of a given teacher.</p>
  
  <p>This is: <code>teacher_one.schedule</code> should return <code>class_hours with ids [1,3]</code> because the one with <code>id == 2</code> is not unique.</p>
  
  <p>In a nutshell: If my teacher has the id <code>1</code>, <code>teacher.schedule</code> would need to return:</p>
  
  <pre><code>id    teacher_id    room_id    hour_id    group_id    subject_id
  1         1            1          1          1            1
  3         1            2          2          1            1
  </code></pre>