title: get child.parent.child.all in child model in rails
body: <p>I have 2 models parent child. I need all child of parent in child model when child has where condition.</p>
  <pre><code>
  class Parent
    has_many :children
  end
  class Child
    belongs_to :parent
  end
  </code>
  </pre>
  <p>I am getting data in child model like</p>
  <pre><code>id: 1
  parent_id: 1
  date: 2022-09-22
  
  id: 2
  parent_id: 1
  date: 2022-09-23
  
  id: 3
  parent_id: 2
  date: 2022-09-24
  </code></pre>
  <p>from <code>Child.where(date: from_date..to_date)</code> and this condition is coming from controller. Now I need one more field here <code>child.parent.child.all</code> in every record. This field is showing wrong data. it is showing data only within selected date range.
  <br>
  i.e. from above example <code>from_date: 2022-09-22 and to_date: 2022-09-24</code> and <code>parent_id: 2</code> have 4 child but in given date range it is showing only 1 because only 1 child data is falling in the given date range. but i need 4.</p>
  <p>Thanks</p>