-
Notifications
You must be signed in to change notification settings - Fork 239
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
Postpone configuration (database introspection) #264
Comments
Great idea; it'd be great to get rid of the hackiness around initialization. Do you know of a reliable loading event I can register with, or would I need to add an If you feel up to it, have a swing at a pull request! |
Hi there! Got the same problem here when testing my app with Rails 5.2.0.rc2. |
I could workaround it with monkey patching :
|
@n-rodriguez Could you warp this in a PR? That would be great! Turns out I didn't know about |
well I'm not sure it it's the way to go... For now I try to make the tests pass on my app with Rails 5.2.0.rc.2 ^^ |
At least I can say it works for me, but I don't know the method call path so other methods may be impacted like : https://github.com/ClosureTree/closure_tree/blob/master/lib/closure_tree/support_attributes.rb#L63 and others. |
Also note that there is some official™ way have been discovered with |
Hi! The PR is here #306 :) |
IMHO I DO think |
Please consider to do database introspection not when calling
has_closure_tree
method (on application code load) but some time later.I'm using Docker Compose for development and because of that I'm launching container with Rails application immediately after container with database has started. Sometimes
has_closure_tree
will be invoked and will attempt to access DB to analyze tables before RDBMS is ready to serve clients. So, application will fail to load and application server will be terminated).Rails itself (without closure_tree) doesn't hit the DB until first request will come, so everything works as expected even if DB was not ready at time of first request (ActiveRecord will analyze tables when DB will be ready).
Also request time (or first model access time) configuration should fix other issues like #214
Thank you for closure_tree!
The text was updated successfully, but these errors were encountered: