Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Can i have multiple call inside single module

Open
#267 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
ruby
Domain
api

Research direction

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.

Written by the indexing model from the issue text.

Description

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

Dominant language
Ruby
Stars
730
Forks
155
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ruby-grape/grape-entity

All issues in ruby-grape/grape-entity

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.