public static function bootOptionallyBoundToApplication()
    {
        static::addGlobalScope('in-application', function (Builder $builder) {
            $builder->where(function ($sq) {
                $sq->whereNull('application_id')->orWhere('application_id', '=', '');

                if ($application = app('soda')->getApplication()) {
                    $sq->orWhere('application_id', '=', $application->getKey());
                }
            });
        });
    }