From 952df2947a9df01e35f34636a5eed3dcbb0919ec Mon Sep 17 00:00:00 2001 From: rgarcia Date: Wed, 17 Jan 2018 12:50:17 +0100 Subject: [PATCH] Duplicate current_budget method in management_base_controller This method is already existent in the application_controller but it seems a little overkill to create a concern just for this method Maybe when we have multiple method it makes sense to create a nice controller. Another option would be to make the management_base_controller extend from the application_controller --- app/controllers/management/base_controller.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/controllers/management/base_controller.rb b/app/controllers/management/base_controller.rb index 66aee5a01..c7610eba9 100644 --- a/app/controllers/management/base_controller.rb +++ b/app/controllers/management/base_controller.rb @@ -5,6 +5,7 @@ class Management::BaseController < ActionController::Base before_action :set_locale helper_method :managed_user + helper_method :current_user private @@ -40,4 +41,7 @@ class Management::BaseController < ActionController::Base I18n.locale = session[:locale] end + def current_budget + Budget.current + end end