ruby on rails - How to change the order that gems are loaded from within one of the gems -
i have 2 gems "coregem" , "addongem". addon gem adds functionality overwrite core gem.
how make sure if second gem added overwrite views , assets of first.
so far works when adding main app:
config.railties_order = [ :main_app, addongem::engine, :all]
but i'd want within addongem.
thanks
where railties_order
used
railties_order
used here:
https://github.com/rails/rails/blob/master/railties/lib/rails/application.rb#l317
to determine ordering of initializer
blocks run,
https://github.com/rails/rails/blob/master/railties/lib/rails/application.rb#l337
found in other gems.
https://github.com/rails/rails/blob/master/railties/lib/rails/application.rb#l47
so setting railties_order
inside initializer
block rather pointless, time initializer
block called, railties_order
set , in used rest of application.
what instead
apparently bunch more initializer
blocks inside rails::application::bootstrap
.
https://github.com/rails/rails/blob/master/railties/lib/rails/application/bootstrap.rb
those prepended before main application's initializer blocks:
https://github.com/rails/rails/blob/master/railties/lib/rails/application.rb#l262
so perhaps can monkey-patch bootstrap module initializers? guess that's call.
Comments
Post a Comment