title: How do you iterate over active record objects in Ruby On Rails?
body: <p>This question is quite simple but I have run into the problem a few times.</p>
  
  <p>Let's say you do something like:</p>
  
  <pre><code>cars = Vehicle.find_by_num_wheels(4)
  
  cars.each do |c|
    puts "#{c.inspect}"
  end
  </code></pre>
  
  <p>This works fine if cars is an array but fails if there is only one car in the database.  Obviously I could do something like "if !cars.length.nil?" or check some other way if the cars object is an array before calling .each, but that is a bit annoying to do every time.</p>
  
  <p>Is there something similar to .each that handles this check for you?  Or is there an easy way to force the query result into an array regardless of the size?</p>