title: Combine two scopes in Rails 4 in the model
body: <p>Please note that similar questions are concerning Rails 3, and the scopes having changed a moderate amount in Rails 4. Only syntactically, but I still would like to have an up-to-date answer.</p>
  
  <p>Anyway, how do I merge these scopes:</p>
  
  <pre><code>class Cat &lt; ActiveRecord::Base
      scope :recent, -&gt; { order('cats.approve_date ASC').limit(5) }
      scope :approved, -&gt; { where( state: 'approved') }
  end
  </code></pre>
  
  <p>If I want to get all the recent cats:</p>
  
  <pre><code>@recent_cats = Cat.recent
  </code></pre>
  
  <p>If I want to get all the approved cats:</p>
  
  <pre><code>@approved_cats = Cat.approved
  </code></pre>
  
  <p>But how do I get all the recent and approved cats? I could use the <code>merge</code> function in the controller, but I want to follow conventions and do this in the model:</p>
  
  <pre><code>class Cat &lt; AciveRecord::Base
      scope :recent_approved, -&gt; { }
  end
  </code></pre>