ruby-grape / grape-entity

An API focused facade that sits on top of an object model.
MIT License
720 stars 153 forks source link

Format is "reserved" #229

Open arempe93 opened 8 years ago

arempe93 commented 8 years ago

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

dblock commented 8 years ago

This is the problem with defined functions vs. fields. It should be fixable, I would start by writing a spec.