shakemurasan/okuribito_rails

Add to wiki trouble shooting when StartObserver does not work fine

Opened this issue · 0 comments

According to the following code, StartObserver starts only if the connection to the DB is established.

config.after_initialize do
StartObserver.new.start if ActiveRecord::Base.connected?
end

In my local environment, sometimes the connection to the DB is established after callbacks in after_initialize run.

In this case, to solve this problem, executing the following code in rails c works well.

OkuribitoRails::StartObserver.new.start

I could not this trouble shooting method to Wiki because editing Wiki by normal contributor is not allowed.

Please mention to this trouble shooting method in Wiki.