Engine initializers

Ohad,

Rail engines' initializers are loaded before the parent app (Foreman) initializers. I would have guessed otherwise.

However, you can get around this by placing the code in a config.to_prepare block in engine.rb

Here is the order.

  1. sample_engine/initializers

  2. foreman/initializers

  3. sample_engine/lib/engine.rb

module SampleEngline
class Engine < ::Rails::Engine
config.to_prepare do
#This will run after Foreman initializers
end
end
end