Can i have multiple call inside single module
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 25/100
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
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ruby-grape/grape-entity
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
ruby-grape/grape-entity#386 · 7 comments · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
ruby-grape/grape-entity#382 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
ruby-grape/grape-entity#380 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
ruby-grape/grape-entity#373 · 2 comments ·
-
Truncate FormatterOpen
Difficulty 1/5 1-3 hours Newbie friendliness 45/100
ruby-grape/grape-entity#372 ·
All issues in ruby-grape/grape-entity
Similar issues
-
chore
Difficulty 1/5 Under an hour Newbie friendliness 78/100
AllYourBot/hostedgpt#818 · 4 comments ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
slovensko-digital/autogram-portal#392 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
voxpupuli/puppet-quadlets#122 · 5 comments ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
TheOdinProject/curriculum#31452 ·
Maintainers usually reply within 1 day