Format is "reserved"

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

Nobody has claimed this yet.

Assessment

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

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.

Description

bug?

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

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

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.

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.