-
Notifications
You must be signed in to change notification settings - Fork 801
stack level too deep with inheritance_enabled when acessing __elasticsearch__.index_name #729
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I am seeing the same problem. I worked around it by adding the below code to my base class, but I don't see why I should need to.
|
@blevine , thanks for posting the workaround. I've seen including the module again in the child classes to fix it as well. Sorry for the silence here, we're scheduling some effort to focus on the |
Another workaround option that's working for me: class Subclass < Superclass
__elasticsearch__.index_name = Superclass.__elasticsearch__.index_name
end Would love to get this resolved with the configuration option though. 😄 |
Just wanted to report that I'm having this same issue. It seems like this code should work, but I think it must be choking on the part where it compares ancestors to self? Not entirely sure.
I haven't had a ton of time to dig into this, but it seems that
And that's what drives this into an infinite loop. Also, for whatever reason, I can't get the |
Fixed by #887 |
hey there,
thanks for the great gem.
just followed your docs and came across the folowwing issue when working with inheritance in my rails models.
With the default settings
Ticket::EmailTicket.__elasticsearch__.index_name
return me the correct index name
ticket-email_tickets
but whenElasticsearch::Model.settings[:inheritance_enabled] = true
I get a
when accessing the index_name. Obviously also for all methods using the index_name
I have very easy inheritance:
Ticket::Ticket
is the superclass ofTicket::EmailTicket
and also includes theElasticsearch::Model
I would expect
Ticket::EmailTicket.__elasticsearch__.index_name
to returnticket-tickets
I'm running on ruby 2.0 and rails 3.2. maybe the modules in my models make this problem.
Happy about any advice.
best
The text was updated successfully, but these errors were encountered: