ruby-grape / ruby-grape/grape-entity

one should be able to change env variables when exposing a collection (nesting) with :using option

Open
#94 2 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
Ruby
Stars
729
Forks
154
PR merge metrics
No merged PRs in 30d

Description

At the moment when one sets :type when calling #present helper method, that type is not going to change throughout nested entities. It should though.
For example: when exposing a nested entity, one might not want it to have the same type set when #present helper method is called.

Also check bug #93.

Contributor guide

Open the contributing guide

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.

Research direction

Start with the #present helper and its :using option, then compare the requested nested-entity behavior with bug #93. Trace how :type is passed into nested entities and confirm that an explicitly selected nested type can differ from the parent while exposing a collection; the related behavior should be covered by a regression test.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.