Class: ElasticsearchRecord::Base
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- ElasticsearchRecord::Base
- Includes:
- Core, ModelSchema, Persistence, Querying
- Defined in:
- lib/elasticsearch_record/base.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#id ⇒ Object
included
from Core
overwrite to provide a Elasticsearch version of returning a 'primary_key' attribute.
-
#id=(value) ⇒ Object
included
from Core
overwrite to provide a Elasticsearch version of setting a 'primary_key' attribute.
-
#id_was ⇒ Object
included
from Core
overwrite to provide a Elasticsearch version of returning a 'primary_key' was attribute.
-
#read_attribute(attr_name, &block) ⇒ Object
included
from Core
overwrite read_attribute method to read from the 'id'-attribute, if present.
-
#write_attribute(attr_name, value) ⇒ Object
included
from Core
overwrite the write_attribute method to always write to the 'id'-attribute, if present.
Instance Method Details
#id ⇒ Object 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+.
#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+.
#id_was ⇒ Object 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