chewy icon indicating copy to clipboard operation
chewy copied to clipboard

update_index problem - UnderivableType error

Open hiyer opened this issue 10 years ago • 5 comments

I have the following index defined in app/chewy/active_houses_index.rb.

class ActiveHousesIndex < Chewy::Index
  define_type House.published...

And the following update_index statement in my House model: update_index "active_houses#house", :self

This is pretty similar to the Users example provided in the docs, so I don't know what I'm doing wrong. Whenever I save a house, I get the following error: #<Chewy::UnderivableType: Can not find index namedHouseIndex>

As an aside, I got the same error even when I renamed the index to HousesIndex (and also renamed the file accordingly).

Chewy version: chewy-0.8.3 Ruby version: 2.1.5

hiyer avatar Feb 16 '16 05:02 hiyer

Didn't see this before. Looks like a bug definitely, could you debug it a little bit please? Have no idea how to reproduce it.

pyromaniac avatar Feb 16 '16 07:02 pyromaniac

@pyromaniac I tried debugging a bit and found the following. In chewy.rb, the Observe.update_proc method gets called twice on loading (via update_index). The first time the type_name is passed in correctly as 'active_houses#house'. The second time - weirdly enough - it changes to 'house#houses'. I couldn't figure out why this change happens (or why update_index gets called twice). If you can provide any pointers I can debug further.

hiyer avatar Feb 16 '16 08:02 hiyer

So have you find the reason?

pyromaniac avatar Feb 20 '16 13:02 pyromaniac

I am also having a similar issue. Were you able to find out the cause @hiyer @pyromaniac

mayank-singh avatar Jun 02 '16 13:06 mayank-singh

Same here, having the same issue on a simple test example I'm trying to do. Anyone found a solution yet?

EDIT: Okay, I was using ruby version 2.1.0, I updated to 2.3.1 and everything is working fine now.

MarioDiar avatar Jul 14 '16 18:07 MarioDiar