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.
-
sample_engine/initializers
-
foreman/initializers
-
sample_engine/lib/engine.rb
module SampleEngline
class Engine < ::Rails::Engine
config.to_prepare do
#This will run after Foreman initializers
end
end
end