{"record":{"id":"a298aa6286dc6bd4","repo":"theforeman/foreman","slug":"unknown-klass-resource-class","errorCode":null,"errorMessage":"Unknown '%{klass}' resource class","messagePattern":"Unknown '%(.+?)' resource class","errorType":"exception","errorClass":"Foreman::Renderer::Errors::UnknownResource","httpStatus":null,"severity":"error","filePath":"app/services/foreman/renderer/scope/macros/inputs.rb","lineNumber":51,"sourceCode":"            returns Object, desc: 'The resource object'\n            example 'input_resource(\"hostgroup\") #=> \"ActiveRecord object\"'\n          end\n          def input_resource(name)\n            @input = template.template_inputs&.find_by_name(name)\n\n            raise UndefinedInput.new(s: name) unless @input\n            raise WrongInputValueType.new(name: name, type: @input.value_type) if @input.value_type != 'resource'\n\n            return resource_klass.new if preview?\n            find_resource\n          end\n\n          private\n\n          def resource_klass\n            @input.resource_type.constantize\n          rescue NameError\n            raise UnknownResource.new(klass: @input.resource_type)\n          end\n\n          def resource_permission\n            \"view_#{@input.resource_type.demodulize.underscore.pluralize}\".to_sym\n          end\n\n          def find_resource\n            resource_klass.authorized(resource_permission)\n                          .find(@input.value(self))\n          end\n        end\n      end\n    end\n  end\nend\n","sourceCodeStart":33,"sourceCodeEnd":67,"githubUrl":"https://github.com/theforeman/foreman/blob/6b05625475cfe6aac31a88f8c8ee6e62e4efe620/app/services/foreman/renderer/scope/macros/inputs.rb#L33-L67","documentation":"Error \"Unknown '%{klass}' resource class\" thrown in theforeman/foreman.","triggerScenarios":"Thrown at app/services/foreman/renderer/scope/macros/inputs.rb:51 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6b05625475cfe6aac31a88f8c8ee6e62e4efe620","analyzedAt":"2026-08-23T17:46:34.094Z","schemaVersion":2},"datasetVersion":"2026-08-23T21:17:23.414Z"}