lib/mix-rails-auth/engine.rb in mix-rails-auth-0.23.1 vs lib/mix-rails-auth/engine.rb in mix-rails-auth-0.24.0

- old
+ new

@@ -4,25 +4,16 @@ config.generators do |g| g.test_framework :rspec g.integration_tool :rspec end - def navigation - if defined? Admix - Admix::Navigation::NavBar.post_menu do - Admix::Navigation::NavBar.find(:general) do |menu| - menu.submenu do |submenu| - submenu.key = :users - submenu.title = I18n.t 'users.users' - submenu.url = 'admix_users_url' - - submenu.instance_eval do - def can_render?(current_user) - current_user.has_role? :admin - end - end - - end + initializer "mix-rails-writer.setup_menu", after: "admix.setup_menu" do + ActiveMenu::get('admix-nav') do |nav| + nav.get(:general) do |general| + general.child :users do |users| + users.text Proc.new {t('users.users')} + users.href Proc.new {admix_users_url} + users.visible Proc.new {current_user.has_role? :admin} end end end end