title: How to invoke a child models scope from parent in ActiveRecord?
body: <p>Please help me to find a way to invoke a child scope inside parent scope. is there any way by which i can achieve that. </p>
  
  <p><strong>The scenario is follows:</strong></p>
  
  <pre><code>class Film &lt; ActiveRecord::Base
    ...
    has_many :shows
    scope :active_shows, -&gt;{
      joins(:shows)
    }
    ...
  end
  
  class Show &lt; ActiveRecord::Base
    ...
    belongs_to :film
    scope :active_for_now, -&gt;{
     ...
    }
    ...
  end
  </code></pre>
  
  <p>From the above Eg, i want to know how to invoke scope <code>active_for_now</code> from <code>active_shows</code>. <code>show</code> table has fields <code>start_time</code> and <code>end_time</code> when i call <code>Film.active_shows</code> have to get all Films having active show for the current time. </p>
  
  <p>please help me if there any solution for that and please correct if i gone wrong. </p>