lib/potassium/templates/application/recipes/pundit.rb in potassium-1.3.4 vs lib/potassium/templates/application/recipes/pundit.rb in potassium-1.3.5

- old
+ new

@@ -1,7 +1,7 @@ authorization_framework = { - pundit: ->{ + pundit: -> do gather_gem 'pundit' after(:gem_install) do application_controller = "app/controllers/application_controller.rb" gsub_file application_controller, "protect_from_forgery" do @@ -15,16 +15,19 @@ initializer = "config/initializers/active_admin.rb" gsub_file initializer, /# config\.authorization_adapter =[^\n]+\n/ do "config.authorization_adapter = ActiveAdmin::PunditAdapter\n" end - template "assets/active_admin/pundit_page_policy.rb", "app/policies/active_admin/page_policy.rb" - template "assets/active_admin/comment_policy.rb", "app/policies/active_admin/comment_policy.rb" - template "assets/active_admin/admin_user_policy.rb", "app/policies/admin_user_policy.rb" + template "assets/active_admin/pundit_page_policy.rb", + "app/policies/active_admin/page_policy.rb" + template "assets/active_admin/comment_policy.rb", + "app/policies/active_admin/comment_policy.rb" + template "assets/active_admin/admin_user_policy.rb", + "app/policies/admin_user_policy.rb" end end - } + end } if get(:authorization) - instance_exec(&(authorization_framework[get(:authorization)] || ->{ })) + instance_exec(&(authorization_framework[get(:authorization)] || -> {})) end