Module: Ladder::Searchable::Resource

Extended by:
ActiveSupport::Concern
Defined in:
lib/ladder/searchable/resource.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#as_indexed_jsonHash

Serialize the resource as JSON for indexing

Returns:

  • (Hash)

    a serialized version of the resource

See Also:

  • Elasticsearch::Model::Serializing#as_indexed_json


12
13
14
# File 'lib/ladder/searchable/resource.rb', line 12

def as_indexed_json(*)
  respond_to?(:serialized_json) ? serialized_json : as_json(except: [:id, :_id])
end