Open arabakevin opened 4 years ago
Hey Kevin,
I tried your code (well, without the mount, and aasm and the like). See here: https://gist.github.com/nviennot/9f636ff7ce952ec9e10001e0aabd7a4a
When I run ruby test255.rb
, I see in the console the two indexes being created:
D, [2019-11-05T21:59:18.682787 #50235] DEBUG -- : [ 24.1ms] r.table("organisations").index_create(:name) {|var_1| var_1[:name]}
D, [2019-11-05T21:59:18.738029 #50235] DEBUG -- : [ 36.9ms] r.table("projects").index_create(:name) {|var_1| var_1[:name]}
Edit: I'm guessing the model where the index does not appear might not be loaded. Verify tha the model is loaded (you can debug this by putting a puts "hello"
in the model file in equestion.
ok thanks. I will test again as soon as possible with your example.
Hi, So, i have retested a new time and on my side i have only one index created. I use Docker do you think it's here the issue ?
The puts "hello"
working properly.
Which information can i provide you to help me again ?
Thanks for your help. kevin
Create the smallest test case that is able to reproduce the bug, and then I'll be able to help
Hi, as discussed I have created a test repository to help you to reproduce more easily my issue. So, you can find how to reproduce the issue here --> https://github.com/arabakevin/nobrainer-issue-255
Thanks. Cheers. Kevin
Hey @nviennot,
I'm also looking for this issue too. Could you please give your input?
Thank you.
In Rails6, the model may not be loaded during development because the autoloader specification has changed.
I solved the problem by setting
config.autoloader = :classic
Thank you @extem, I'll try that.
Hi @extem , Thanks for your help i have tested and it's working properly on my side.
We can close this issue for me.
kevin.
@nviennot should the documentation be updated with this option? And the nobrainer post install script to add this option?
It's probably best to invoke the eager loading of the models (e.g., Zeitwerk::Loader.eager_load_all
) when the models should be loaded.
In particular, https://github.com/nviennot/nobrainer/blob/master/lib/no_brainer/document/core.rb#L28 should work
Yes, but I'm more thinking of nobrainer working out-of-the-box with Rails 6.
Me too, NoBrainer should invoke the proper rails incantation to make sure all models are loaded when needed
Hi, i have two models my first one is "Organiasation"
And a second who is named "Project"
So, in the both models i have one index. When i started with an empty database. And i use this command to sync the indexes:
i can see only one index created and this one is only the index of
Organisation
and the index of the second model is not created.Thanks. Regards. kevin