grape-entity
grape-entity copied to clipboard
An API focused facade that sits on top of an object model.
Hey guys! I'm having an issue using Grape with cache (Garner) and send the results with grape-entity. The issue is: the second time I request an object Garner start working,...
Maybe clarify that you can call methods on objects like this: ``` expose :categories, :using => CategoryEntity do | instance | instance.method_that_returns_categories(option_1, option_2) end ``` Useful if you use a...
Hey again :) I'm using this inside an AR model class: def links { self: topic_path(self), publish: publish_topic_path(self) } end And the entity associated to this model features: expose :links,...
`valid_exposure?` uses `respond_to?`, and does not work with `method_missing`. Something like this would make it work ``` ruby def respond_to_attribute?(object, attribute) object.send(attribute) true rescue false end ``` but it does...
Right now grape-entity supports conversion to json by using 'multi_json'. Do you think it's a good idea to require "active_support/core_ext/hash/conversions.rb" to enable xml formatting for to_xml method?
We had this in the Rakefile ``` # # TODO: setup a place for documentation and then get this going again. # # begin # require 'yard' # DOC_FILES =...
### Context A PR addressing this issue: https://github.com/ruby-grape/grape-entity/issues/368 The thing I am confused about is why we check if `object.respond_to?(:fetch, true)`. Implementing `#fetch` is tricky and I think that most...
### Context When delegating to a `FetchableObject`, we've seen that it can cause breaking changes since it's only checking `object.respond_to?(:fetch, true)` [here](https://github.com/ruby-grape/grape-entity/blob/6eac458ddd69117ad979aaab7d1798bb1ba5a349/lib/grape_entity/delegator.rb#L18) as opposed to checking if the object is...
Fix the method Grape::Entity#exec_with_object to work with Ruby 3.
I use grape gem version is that: ``` grape (~> 1.8) grape-entity (~> 1.0) grape-middleware-logger (~> 1.12) grape-swagger (~> 1.6) grape-swagger-entity (~> 0.5) ``` When I use `rails 7.1.0`, the...