lib/hackathon_manager/engine.rb in hackathon_manager-0.4.2 vs lib/hackathon_manager/engine.rb in hackathon_manager-0.4.3

- old
+ new

@@ -13,9 +13,21 @@ hackathon_manager/vendor/*.css hackathon_manager/mailer.css ] end + # Watch hackathon.yml for changes & reload + initializer "hackathon_manager.watch_hackathon_config", after: :load_config_initializers do |app| + hackathon_config_reloader = app.config.file_watcher.new(['config/hackathon.yml']) do + HackathonManager.reload_config(app) + end + + app.reloaders << hackathon_config_reloader + + # Reload renderers in dev when files change + app.config.to_prepare { hackathon_config_reloader.execute_if_updated } + end + # Initializer to combine this engines static assets with the static assets of the hosting site. initializer "static assets" do |app| app.middleware.insert_before(::ActionDispatch::Static, ::ActionDispatch::Static, "#{root}/public") end