Skip to content

elasticsearch models and STI #28

@iffyuva

Description

@iffyuva

right now, overriding index_name and document_type won't work properly with rails STI
consider this example:

class Animal < ActiveRecord::Base
  document_type 'mammal'
  index_name 'mammals'
end

class Dog < Animal
end

Animal.document_type   # 'mammal'
Animal.index_name      # 'mammals'
Dog.document_type      # 'dog'
Dog.index_name         # 'dogs'

Since document_type and index_name are redefined in base class, i would expect the same to be reflected in derived classes also, but thats not happening. So, i have to manually redefine them in all the derived classes. Is this a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions