Method: Jets::Booter.boot!

Defined in:
lib/jets/booter.rb

.boot!Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/jets/booter.rb', line 6

def boot!
  return if @booted

  confirm_jets_project!
  Jets::Bundle.require

  Jets.application.setup!

  # Turbines are loaded after setup_autoload_paths in Jets.application.setup!  Some Turbine options are defined
  # in the project so setup must happen before internal Turbines are loaded.
  load_internal_turbines

  run_turbines(:initializers)
  # Load configs after Turbine initializers so Turbines can defined some config options and they are available in
  # user's project environment configs.
  Jets.application.configs!
  app_initializers
  run_turbines(:after_initializers)
  Jets.application.finish!

  setup_db # establish db connections in Lambda Execution Context.
  # The eager load calls connects_to in models and establish those connections in Lambda Execution Context also.
  internal_finisher
  eager_load

  # TODO: Figure out how to build middleware during Jets.boot without breaking jets new and webpacker:install
  # build_middleware_stack

  @booted = true
end