protected function getTranslationsRelation($query)
    {
        /** @var Builder $query */
        /** @var Model|Translatable $model */
        $model = $query->getModel();

        if ( ! method_exists($model, 'translations')) {
            // @codeCoverageIgnoreStart
            throw new RuntimeException('Model ' . get_class($model) . ' is not a translated model.');
            // @codeCoverageIgnoreEnd
        }

        return $model->translations();
    }