Remove redundant calls to load resources

We already load the budget and the ballot in `before_action` calls, so
we don't have to load them again.
This commit is contained in:
Javi Martín
2020-07-12 23:05:39 +02:00
parent 7ce2d8b7eb
commit aff213b0ef
2 changed files with 3 additions and 3 deletions

View File

@@ -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

View File

@@ -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]