module ElasticArSync::Elastic::Syncable
Public Instance Methods
as_indexed_json(_option = {})
click to toggle source
# File lib/elastic_ar_sync/elastic/syncable.rb, line 39 def as_indexed_json(_option = {}) hash = {} self.class.mapping_list_keys.each { |key| hash[key.to_s] = send(key) } hash.as_json end
document_sync_create(klass, record_id)
click to toggle source
# File lib/elastic_ar_sync/elastic/syncable.rb, line 27 def document_sync_create(klass, record_id) ElasticArSync::Elastic::Worker::IndexWorker.perform_async(klass, :index, record_id) end
document_sync_delete(klass, record_id)
click to toggle source
# File lib/elastic_ar_sync/elastic/syncable.rb, line 35 def document_sync_delete(klass, record_id) ElasticArSync::Elastic::Worker::IndexWorker.perform_async(klass, :delete, record_id) end
document_sync_update(klass, record_id)
click to toggle source
# File lib/elastic_ar_sync/elastic/syncable.rb, line 31 def document_sync_update(klass, record_id) ElasticArSync::Elastic::Worker::IndexWorker.perform_async(klass, :index, record_id) end