JsonApiResourceAdapters
A collection of handy adapters for projects tha use JsonApiResource
Installation
Add this line to your application's Gemfile:
gem 'json_api_resource_adapters'
And then execute:
$ bundle
Or install it yourself as:
$ gem install json_api_resource_adapters
Usage
Include the gem and you will have access to
Autobots::JsonApiResourceAssembler
This is an adapter for autobots that allows autobots to bulk fetch records for caching.
The setup is pretty simple:
module MyApi
module V1
class MyAssembler < Autobots::JsonApiResourceAssembler
self.cache = Rails.cache
end
end
end
Elasticsearch adapter
This is an adapter for elasticsearch-model
There's nothing you have to do. It will autoload and let you call interacr with your resource class the same way you would with an ActiveRecord model
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/gaorlov/json_api_resource_adapters.
License
The gem is available as open source under the terms of the MIT License.