Inheritance Problem

I have the same Problem in find.
Car.find(:all) returns two Records
Car.find(:all) returns four Records

This is a known pecularity of STI - when you do a count for the
subclass it adds a type = "Car" condition. This obviously doesn't find
instances of RallyCar. Once the RallyCar class is loaded then
ActiveRecord is aware of its existance and will add type = "Car" or
type = "RallyCar" as the condition. It's a bit messy but in production
it should work fine (since all classes are loaded up front) or you can
also use require_dependency to force them to be loaded (ie at the
bottom of car.rb stick require_dependency 'rally_car')