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:
@@ -9,8 +9,8 @@ module Budgets
|
|||||||
before_action :load_investments
|
before_action :load_investments
|
||||||
before_action :load_ballot_referer
|
before_action :load_ballot_referer
|
||||||
|
|
||||||
load_and_authorize_resource :budget
|
authorize_resource :budget
|
||||||
load_and_authorize_resource :ballot, class: "Budget::Ballot", through: :budget
|
authorize_resource :ballot
|
||||||
load_and_authorize_resource :line, through: :ballot, find_by: :investment_id, class: "Budget::Ballot::Line"
|
load_and_authorize_resource :line, through: :ballot, find_by: :investment_id, class: "Budget::Ballot::Line"
|
||||||
|
|
||||||
def create
|
def create
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ module Budgets
|
|||||||
class BallotsController < ApplicationController
|
class BallotsController < ApplicationController
|
||||||
before_action :authenticate_user!
|
before_action :authenticate_user!
|
||||||
before_action :load_budget
|
before_action :load_budget
|
||||||
load_and_authorize_resource :budget
|
authorize_resource :budget
|
||||||
before_action :load_ballot
|
before_action :load_ballot
|
||||||
after_action :store_referer, only: [:show]
|
after_action :store_referer, only: [:show]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user