ruby-grape / ruby-grape/grape-entity

Format is "reserved"

Open
#229 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I am using grape, grape entity, and rails together for an api. I have a rails model that has a column, format. When I try to expose this column, I get an error that looks something like -

too few arguments
... /gems/grape-entity-0.5.1/lib/grape_entity/entity.rb:482:in `format'
... /gems/grape-entity-0.5.1/lib/grape_entity/entity.rb:482:in `delegate_attribute'

The entity in question

class Content < Grape::Entity
  expose :id, :guid, :slug, :metadata, :url, :format
end

I am using grape@0.16.2 and grape-entity@0.5.1

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

Reproduce the failure with the Content entity and its exposed format column using grape 0.16.2 and grape-entity 0.5.1. Start at grape_entity/entity.rb:482, where format is reported in delegate_attribute; done means exposing format no longer raises the argument error and the column is returned correctly.

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.