blueprinter
blueprinter copied to clipboard
Simple, Fast, and Declarative Serialization Library for Ruby
Currently, blueprinter does not attempt to eager load associations for collections of activerecords (ActiveRecordRelation). This results in n+1 queries being performed. The way this is resolved at the moment is...
When I tried to use default_if I got this error ``` class RestaurantBlueprint < Blueprinter::Base ... field :meal do |package| { price: package.price, default_if: Blueprinter::EmptyString, default: "N/A", original_price: package.original_price }...
### Benchmark comparison: Output on Ruby 2.6.9, MacBook Pro (15-inch, 2018, 2.2 GHz 6-Core Intel Core i7) [benchmark code](https://gist.github.com/midhun-thimmapuram/f6b45744e77f01750db64eb5f7a7a61e) _blueprinter 0.25.3 (current master)_ ``` Rehearsal ----------------------------------------------- blueprinter 0.362873 0.004129 0.367002...
Many open PRs and stuck commits since last year
Fix for [#225](https://github.com/procore/blueprinter/issues/225)
This PR will add framework agnostic caching support. I took inspiration from the latest cache implementation of [jsonapi-serializer](https://github.com/jsonapi-serializer/jsonapi-serializer#caching) a fork from the Netflix's fast_jsonapi. ### How it works ```ruby class...
I created a Blueprint like that: ```rb class FirstBlueprint < Blueprinter::Base identifier :id fields :title, :starts_at, :ends_at end ``` What i found out a bit later is, that the date...
* Raising errors on invalid included views * ReRaising error with details on extraction error
Hi I was trying to render a list of objects, and for each object, I needed to retrieve a specific associated object and calculate some attributes. Here's a concrete example:...