Use :only in groups and headings before_action

When we've got 6 actions and we use it in 3, IMHO the code is easier to
follow if we write the actions where we do use it.
This commit is contained in:
Javi Martín
2021-06-03 02:48:27 +02:00
parent 9d72aed37d
commit 01c21158c4
2 changed files with 2 additions and 2 deletions

View File

@@ -4,7 +4,7 @@ class Admin::BudgetGroupsController < Admin::BaseController
feature_flag :budgets
before_action :load_budget
before_action :load_group, except: [:index, :new, :create]
before_action :load_group, only: [:edit, :update, :destroy]
def index
@groups = @budget.groups.order(:id)

View File

@@ -5,7 +5,7 @@ class Admin::BudgetHeadingsController < Admin::BaseController
before_action :load_budget
before_action :load_group
before_action :load_heading, except: [:index, :new, :create]
before_action :load_heading, only: [:edit, :update, :destroy]
def index
@headings = @group.headings.order(:id)