lib/active_admin/comments.rb in activeadmin-0.4.4 vs lib/active_admin/comments.rb in activeadmin-0.5.0.pre

- old
+ new

@@ -14,15 +14,18 @@ ActiveAdmin::Resource.send :include, ActiveAdmin::Comments::ResourceHelper # Add the module to the show page ActiveAdmin.application.view_factory.show_page.send :include, ActiveAdmin::Comments::ShowPageHelper -# Generate a Comment resource when namespaces are registered -ActiveAdmin::Event.subscribe ActiveAdmin::Application::LoadEvent do |app| +# Walk through all the loaded resources after they are loaded +ActiveAdmin.after_load do |app| app.namespaces.values.each do |namespace| if namespace.comments? namespace.register ActiveAdmin::Comment, :as => "Comment" do actions :index, :show, :create + + # Ensure filters are turned on + config.filters = true # Don't display in the menu menu false # Don't allow comments on comments