Class: ElasticsearchRecord::Base

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
Core, ModelSchema, Persistence, Querying
Defined in:
lib/elasticsearch_record/base.rb

Direct Known Subclasses

SchemaMigration

Instance Method Summary collapse

Instance Method Details

#idObject Originally defined in module Core

overwrite to provide a Elasticsearch version of returning a 'primary_key' attribute. Elasticsearch uses the static +_id+ column as primary_key, but also supports an additional +id+ column. To provide functionality of returning the +id+ attribute, this method must also support it with enabled +relay_id_attribute+.

Returns:

  • (Object)

#id=(value) ⇒ Object Originally defined in module Core

overwrite to provide a Elasticsearch version of setting a 'primary_key' attribute. Elasticsearch uses the static +_id+ column as primary_key, but also supports an additional +id+ column. To provide functionality of setting the +id+ attribute, this method must also support it with enabled +relay_id_attribute+.

Parameters:

  • value (Object)

#id_wasObject Originally defined in module Core

overwrite to provide a Elasticsearch version of returning a 'primary_key' was attribute. Elasticsearch uses the static +_id+ column as primary_key, but also supports an additional +id+ column. To provide functionality of returning the +id_Was+ attribute, this method must also support it with enabled +relay_id_attribute+.

#read_attribute(attr_name, &block) ⇒ Object Originally defined in module Core

overwrite read_attribute method to read from the 'id'-attribute, if present. This methods does not check for +relay_id_attribute+ flag! see @ ActiveRecord::AttributeMethods::Read#read_attribute

#write_attribute(attr_name, value) ⇒ Object Originally defined in module Core

overwrite the write_attribute method to always write to the 'id'-attribute, if present. This methods does not check for +relay_id_attribute+ flag! see @ ActiveRecord::AttributeMethods::Write#write_attribute