bradrobertson/apartment

View on GitHub
lib/apartment/console.rb

Summary

Maintainability
A
0 mins
Test Coverage
# A workaraound to get `reload!` to also call Apartment::Database.init
# This is unfortunate, but I haven't figured out how to hook into the reload process *after* files are reloaded

# reloads the environment
def reload!(print=true)
  puts "Reloading..." if print
  # This triggers the to_prepare callbacks
  ActionDispatch::Callbacks.new(Proc.new {}).call({})
  # Manually init Apartment again once classes are reloaded
  Apartment::Database.init
  true
end