Closed
Description
Hi,
Question: Due to the way exposures are looked up in the entity class first (calling respond_to attribute, true
), attributes defined on the delegate class that collide with Kernel
methods can not be exposed. We today noticed that with a AR model that has a belongs_to :system
association. Probably poor wording on our side, but still: What would be the preferred way to deal with this? Currently we need to monkey-patch Grape::Entity#delegate_attribute
.
class Foo < ActiveRecord::Base
belongs_to :system
class Entity < Grape::Entity
expose :system
end
end
Thanks,
Malte