Changed ActiveRecordBase::total() to ::countAll()