lib/decidim/dev/engine.rb in decidim-dev-0.28.0.rc4 vs lib/decidim/dev/engine.rb in decidim-dev-0.28.0.rc5

- old
+ new

@@ -5,18 +5,35 @@ # Decidim's development Rails Engine. class Engine < ::Rails::Engine isolate_namespace Decidim::Dev engine_name "decidim_dev" + routes do + root to: proc { [200, {}, ["DUMMY ENGINE"]] } + + resources :dummy_resources do + resources :nested_dummy_resources + get :foo, on: :member + end + end + initializer "decidim_dev.tools" do # Disable if the boost performance mode is enabled next if Rails.application.config.try(:boost_performance) - ActiveSupport.on_load(:action_controller) { include Decidim::Dev::NeedsDevelopmentTools } + ActiveSupport.on_load(:action_controller) { include Decidim::Dev::NeedsDevelopmentTools } if Rails.env.development? || ENV.fetch("DECIDIM_DEV_ENGINE", nil) end initializer "decidim_dev.webpacker.assets_path" do Decidim.register_assets_path File.expand_path("app/packs", root) + end + + initializer "decidim_dev.moderation_content" do + config.to_prepare do + ActiveSupport::Notifications.subscribe("decidim.admin.block_user:after") do |_event_name, data| + Decidim::Dev::HideAllCreatedByAuthorJob.perform_later(**data) + end + end end end end end