Created
February 21, 2014 15:23
-
-
Save aahmad/9136130 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
after_commit :reindex_es_async | |
def reindex_es_async | |
begin | |
Elasticsearch.reindex "Event", self.event_id | |
rescue | |
end | |
end | |
Sidekiq: | |
def perform model_to_reindex, id | |
model_to_reindex.constantize.find(id).try(:reindex) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment