title: Filters on ActiveRecord collection without firing off additional sql query
body: <p>I make a query like so in order to return an ActiveRecord collection of objects:</p>
  
  <pre><code>@animals = Animal.all
  </code></pre>
  
  <p>Then elsewhere in my code I grab records from that collection:</p>
  
  <pre><code>#fires off additional sql query but I do not want it to
  @specific_animals = @animals.where(animal_type: 'mammal')
  
  #fires off additional sql query but I do not want it to
  @specific_animals = @animals.where(animal_type: 'bird')
  </code></pre>
  
  <p>I only want the first statement of <code>Animal.all</code> to fire off an sql query.  I would think that once you have the collection, there is no reason to query the database again for filters on that collection.</p>
  
  <p><strong>Question:</strong> How can I make it so that I can filter that ActiveRecord collection without making additional queries to the database?</p>