Sha256: 9548d78fe8b1e1bf3a5af1f3da0e35ca2d84027cf6d197e66fef6db90cfee9f0

Contents?: true

Size: 299 Bytes

Versions: 3

Compression:

Stored size: 299 Bytes

Contents

class ::ArticleWithCustomSerialization < ActiveRecord::Base
  include Elasticsearch::Model
  include Elasticsearch::Model::Callbacks

  mapping do
    indexes :title
  end

  def as_indexed_json(options={})
    # as_json(options.merge root: false).slice('title')
    { title: self.title }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
elasticsearch-model-6.1.2 spec/support/app/article_with_custom_serialization.rb
elasticsearch-model-6.1.1 spec/support/app/article_with_custom_serialization.rb
elasticsearch-model-6.1.0 spec/support/app/article_with_custom_serialization.rb