diff --git a/app/controllers/budgets/ballot/lines_controller.rb b/app/controllers/budgets/ballot/lines_controller.rb index 124bfba83..e9df6ab2c 100644 --- a/app/controllers/budgets/ballot/lines_controller.rb +++ b/app/controllers/budgets/ballot/lines_controller.rb @@ -9,8 +9,8 @@ module Budgets before_action :load_investments before_action :load_ballot_referer - load_and_authorize_resource :budget - load_and_authorize_resource :ballot, class: "Budget::Ballot", through: :budget + authorize_resource :budget + authorize_resource :ballot load_and_authorize_resource :line, through: :ballot, find_by: :investment_id, class: "Budget::Ballot::Line" def create diff --git a/app/controllers/budgets/ballots_controller.rb b/app/controllers/budgets/ballots_controller.rb index 7015c8285..52b68c630 100644 --- a/app/controllers/budgets/ballots_controller.rb +++ b/app/controllers/budgets/ballots_controller.rb @@ -2,7 +2,7 @@ module Budgets class BallotsController < ApplicationController before_action :authenticate_user! before_action :load_budget - load_and_authorize_resource :budget + authorize_resource :budget before_action :load_ballot after_action :store_referer, only: [:show]