Remove redundant code to set ballot referer

We were setting it twice: once inside the action and once after the
action.
This commit is contained in:
Javi Martín
2021-03-19 13:46:42 +01:00
parent 2552330fe0
commit 644557a094

View File

@@ -4,7 +4,6 @@ module Budgets
before_action :load_budget
authorize_resource :budget
before_action :load_ballot
after_action :store_referer, only: [:show]
def show
authorize! :show, @ballot
@@ -22,9 +21,5 @@ module Budgets
query = Budget::Ballot.where(user: current_user, budget: @budget)
@ballot = @budget.balloting? ? query.first_or_create! : query.first_or_initialize
end
def store_referer
session[:ballot_referer] = request.referer
end
end
end