ruby-grape / ruby-grape/grape-entity
Discussion on how to handle reopening exposures.
Open
Nobody has claimed this yet.
feature
question
- Dominant language
- Ruby
- Stars
- 729
- Forks
- 154
- PR merge metrics
- No merged PRs in 30d
Description
Example.
class Person < Grape::Entity
expose :user do
expose(:in_first) { |_| 'value' }
end
end
class Student < Person
expose :user do
expose(:user_id) { |_| 'value' }
expose(:user_display_id, as: :display_id) { |_| 'value' }
end
end
- Current behaviour is that both exposures are merged.
- @dblock expressed his concern that this does not follow the same logic as redefining a method: The old method gets overwritten; so if you want to call it, you would use
super.
Contributor 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.
Research direction
No implementation file or test is named. Start by reading the exposure-inheritance example and related pull request #63, then establish whether reopening should merge exposures or replace them; the issue is done only once the project agrees on the behavior and its expected coverage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- api
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100