multithreading - Rails engine creates circular dependency fault -


i have app rails engine use. i've stripped them down pretty bone, fault when start engine multi-threading enabled. faults out missing constant model name i'm calling controller. i've reduced down calling model.all.pluck(:id). , still fault. models being invoked via ajax call controller.

the app runs correctly if refresh page , continue, never faulting out again, can see.

i think it's multi-treading issue, i'm using rails 4.1, ruby 2.12 , puma 2.8.2 , postgress.

this happening on development system macbook. don't see in heroku logs when deploy, ??

now curious. i've made issue go away, forcing app load each model in engine, 1 @ time. things seem run smoothly after that.

any suggestions on how dubug this

this directly linked config.eager_load settings of app. in production set true not have circular dependency problem, in development set false , that's rails auto loading systems may trigger kind of error.

i believe (though i'm not certain) can solve not declaring nested classes , modules in 1 single line

instead of

class mymodule::myclass   ... end 

use

module mymodule   class myclass     ...   end end 

Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -