Remove redundant calls to load resources
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user