Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Can i have multiple call inside single module

Abierto
#267 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
25/100
Tipo de issue
Error
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
ruby
Área
api

Línea de trabajo

Start with app/api/proj/api/v2/entities/committee.rb and compare the defined Committee and CommitteeWithSubcommittees classes with the Grape present calls. Check the corresponding standalone committee_list.rb file and determine whether the intended entity name is CommitteeWithSubcommittees or CommitteeList. Done means the intended entity can be referenced from the single file without breaking presentation.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

I want to have multiple classes inside grape entity file, this is the folder structure app/api/proj/api/v2/entities/committee.rb

module PROJ::API::V2::Entities
class Committee < Grape::Entity
expose :id

expose :name, :full_name, :email, :tag, :parent_id

expose :country do |entity, option|
entity.parent.name if entity.parent.present?
end

include Urls

private
def self.namespace_path
"committees"
end
end

class CommitteeWithSubcommittees < CommitteeBase
# include ProfilePhoto
expose :suboffices, with: 'PROJ::API::V2::Entities::CommitteeBase'
end
and inside the grape api

present @committees, with: PROJ::API::V2::Entities::Committee
is working. but if i present with

present @committees, with: PROJ::API::V2::Entities::CommitteeList
it is not working. But it works when i move it to a new file named committee_list.rb inside entities

Lenguaje dominante
Ruby
Estrellas
730
Forks
155
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de ruby-grape/grape-entity

Todos los issues de ruby-grape/grape-entity

Issues similares

Más issues de Ruby

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.