Skip to content

Instantly share code, notes, and snippets.

View joshuachestang's full-sized avatar

Joshua Chestang joshuachestang

View GitHub Profile
# An example of elasticsearch & Tire setup for ActiveRecord associations.
#
# A `Book has_many :chapters` scenario, with mapping and JSON serialization
# for indexing associated models.
#
# Demonstrates three important caveats as of now:
#
# 1. You you have to use `touch: true` in the `belongs_to` declaration,
# to automatically notify the parent model about the update.
#