Merge pull request #4070 from consul/remove-redundant-calls

Remove redundant calls to load resources
This commit is contained in:
Javier Martín
2020-08-06 14:18:39 +02:00
committed by GitHub
5 changed files with 6 additions and 6 deletions

View File

@@ -2,7 +2,7 @@ module Budgets
class ExecutionsController < ApplicationController
before_action :load_budget
load_and_authorize_resource :budget
authorize_resource :budget
def show
authorize! :read_executions, @budget

View File

@@ -2,8 +2,8 @@ module Budgets
class GroupsController < ApplicationController
before_action :load_budget
before_action :load_group
load_and_authorize_resource :budget
load_and_authorize_resource :group, class: "Budget::Group"
authorize_resource :budget
authorize_resource :group, class: "Budget::Group"
before_action :set_default_budget_filter, only: :show
has_filters %w[not_unfeasible feasible unfeasible unselected selected winners], only: [:show]

View File

@@ -12,7 +12,7 @@ module Budgets
before_action :authenticate_user!, except: [:index, :show, :json_data]
before_action :load_budget, except: :json_data
load_and_authorize_resource :budget, except: :json_data
authorize_resource :budget, except: :json_data
load_and_authorize_resource :investment, through: :budget, class: "Budget::Investment",
except: :json_data

View File

@@ -3,7 +3,7 @@ module Budgets
before_action :load_budget
before_action :load_heading
load_and_authorize_resource :budget
authorize_resource :budget
def show
authorize! :read_results, @budget

View File

@@ -1,7 +1,7 @@
module Budgets
class StatsController < ApplicationController
before_action :load_budget
load_and_authorize_resource :budget
authorize_resource :budget
def show
authorize! :read_stats, @budget