Refactor ActiveQuery instead ActiveRecordInterface

Not work autocomplete for

```
class Sector extends \yii\db\ActiveRecord {
    public function getLengthPairings()
    {
         return $this
            ->hasMany(Piping::className(), ['sector_id' => 'id'])
            ->sum('length'); //here sum not autocomplete 
    }
}
```