From f7c505392a2b8160d634bd08a8e36b6f1c85a4e4 Mon Sep 17 00:00:00 2001 From: kikito Date: Wed, 28 Dec 2016 17:42:47 +0100 Subject: [PATCH] Adds new route and matching ability for administrators --- app/models/abilities/administrator.rb | 2 +- config/routes.rb | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/models/abilities/administrator.rb b/app/models/abilities/administrator.rb index 037289226..8d7694b32 100644 --- a/app/models/abilities/administrator.rb +++ b/app/models/abilities/administrator.rb @@ -45,7 +45,7 @@ module Abilities can [:index, :read, :new, :create, :update, :destroy], Budget can [:read, :create, :update, :destroy], Budget::Group can [:read, :create, :update, :destroy], Budget::Heading - can [:hide, :update], Budget::Investment + can [:hide, :update, :toggle_selection], Budget::Investment can :valuate, Budget::Investment, budget: { valuating: true } can :create, Budget::ValuatorAssignment diff --git a/config/routes.rb b/config/routes.rb index 40ecace70..cc76297f6 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -165,7 +165,9 @@ Rails.application.routes.draw do end end - resources :budget_investments, only: [:index, :show, :edit, :update] + resources :budget_investments, only: [:index, :show, :edit, :update] do + member { patch :toggle_selection } + end end resources :signature_sheets, only: [:index, :new, :create, :show]