diff --git a/app/controllers/cost_objects_controller.rb b/app/controllers/cost_objects_controller.rb index defc8073d2..40f2d0a7dd 100644 --- a/app/controllers/cost_objects_controller.rb +++ b/app/controllers/cost_objects_controller.rb @@ -18,16 +18,16 @@ #++ class CostObjectsController < ApplicationController - before_filter :find_cost_object, only: [:show, :edit, :update, :copy] - before_filter :find_cost_objects, only: :destroy - before_filter :find_project, only: [ + before_action :find_cost_object, only: [:show, :edit, :update, :copy] + before_action :find_cost_objects, only: :destroy + before_action :find_project, only: [ :new, :create, :update_material_budget_item, :update_labor_budget_item ] - before_filter :find_optional_project, only: :index + before_action :find_optional_project, only: :index - before_filter :authorize_global, only: :index - before_filter :authorize, except: [ + before_action :authorize_global, only: :index + before_action :authorize, except: [ # unrestricted actions :index, :update_material_budget_item, :update_labor_budget_item diff --git a/app/controllers/cost_types_controller.rb b/app/controllers/cost_types_controller.rb index c0988ad16a..f737c18e74 100644 --- a/app/controllers/cost_types_controller.rb +++ b/app/controllers/cost_types_controller.rb @@ -19,8 +19,8 @@ class CostTypesController < ApplicationController # Allow only admins here - before_filter :require_admin - before_filter :find_cost_type, only: [:edit, :update, :set_rate, :destroy, :restore] + before_action :require_admin + before_action :find_cost_type, only: [:edit, :update, :set_rate, :destroy, :restore] layout 'admin' helper :sort diff --git a/app/controllers/costlog_controller.rb b/app/controllers/costlog_controller.rb index a8d9a6fc70..645d36bd34 100644 --- a/app/controllers/costlog_controller.rb +++ b/app/controllers/costlog_controller.rb @@ -19,14 +19,14 @@ class CostlogController < ApplicationController menu_item :work_packages - before_filter :find_project, :authorize, only: [:edit, + before_action :find_project, :authorize, only: [:edit, :new, :create, :update, :destroy] - before_filter :find_associated_objects, only: [:create, + before_action :find_associated_objects, only: [:create, :update] - before_filter :find_optional_project, only: [:report, + before_action :find_optional_project, only: [:report, :index] helper :sort diff --git a/app/controllers/hourly_rates_controller.rb b/app/controllers/hourly_rates_controller.rb index c1efd8d543..795b2a207a 100644 --- a/app/controllers/hourly_rates_controller.rb +++ b/app/controllers/hourly_rates_controller.rb @@ -24,13 +24,13 @@ class HourlyRatesController < ApplicationController helper :hourly_rates include HourlyRatesHelper - before_filter :find_user, only: [:show, :edit, :update, :set_rate] + before_action :find_user, only: [:show, :edit, :update, :set_rate] - before_filter :find_optional_project, only: [:show, :edit, :update] - before_filter :find_project, only: [:set_rate] + before_action :find_optional_project, only: [:show, :edit, :update] + before_action :find_project, only: [:set_rate] # #show, #edit have their own authorization - before_filter :authorize, except: [:show, :edit, :update] + before_action :authorize, except: [:show, :edit, :update] # TODO: this should be an index def show diff --git a/lib/open_project/costs/patches/projects_controller_patch.rb b/lib/open_project/costs/patches/projects_controller_patch.rb index 05e6193162..1a807d54c8 100644 --- a/lib/open_project/costs/patches/projects_controller_patch.rb +++ b/lib/open_project/costs/patches/projects_controller_patch.rb @@ -22,7 +22,7 @@ module OpenProject::Costs::Patches::ProjectsControllerPatch base.send(:include, InstanceMethods) base.class_eval do - before_filter :own_total_hours, only: [:show] + before_action :own_total_hours, only: [:show] end end