Account Scope initializer not compatible with Spring Preloader (for development)
jeffnappi opened this issue · comments
Jeff Nappi commented
The account scope initialization using ActiveRecordScopeFactory currently takes a reference to the scoped class at startup. This is not compatible with the Rails Spring loader which provides a dramatic speedup during app development.
I understand that this may be by design, but I'd like to discuss potential workarounds at least for development.
Jeff Nappi commented
I have resolved this for the moment by adding a Spring.after_fork hook in environments/development.rb:
Spring.after_fork do
DoubleEntry.configure do |config|
config.accounts = nil
config.transfers = nil
end
load 'config/initializers/double_entry.rb'
end
Orien Madgwick commented
Good to hear you've resolved your issue @jeffnappi. Do you have recommendations that you'd like implemented in DoubleEntry?