From 22208da3a4ad4aafe4e7764e5ea6f9c421aa4516 Mon Sep 17 00:00:00 2001 From: Niklas van Schrick Date: Mon, 16 Feb 2026 20:40:57 +0100 Subject: [PATCH] Fix user_abilities in application type --- app/graphql/types/base_object.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/graphql/types/base_object.rb b/app/graphql/types/base_object.rb index 5251a772..6f7ae007 100644 --- a/app/graphql/types/base_object.rb +++ b/app/graphql/types/base_object.rb @@ -56,8 +56,9 @@ def self.expose_abilities(abilities, entity_name: graphql_name, subject_resolver field :user_abilities, type_class, null: false, - description: "Abilities for the current user on this #{entity_name}", - method: :itself + description: "Abilities for the current user on this #{entity_name}" + + define_method(:user_abilities) { object || {} } end def self.lookahead_field(field, base_scope:, lookaheads: [], conditional_lookaheads: {})