No commit activity in last 3 years
No release in over 3 years
The easy way to add active model serializers to your tire results
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0

Runtime

 Project Readme

Active Model Serializers + Tire (Beta)

The easy way to add Active Model Serializers to your Tire (client for the Elasticsearch search engine) results.

Installation

Drop this line to your application's Gemfile:

gem 'tire-am_serializers'

Usage

Same as Active Model Serializers:

render json: User.search(...)

There is only one thing, Rails will look for TireUserSeralizer by default. If class doesn't exist, it will try to find UserSerailizer. If no Serilaizers present for this model, it will use default behaviour of to_json.

If you want to get old behaviour from Tire:

render json: Vacancy.search("*").to_json

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request