Setups in investments controller for Polymorphic concern

This commit is contained in:
Eduardo Martinez Echevarria
2017-06-11 14:00:19 +02:00
parent afad69fb71
commit 2e67c860fd

View File

@@ -24,6 +24,7 @@ module Budgets
invisible_captcha only: [:create, :update], honeypot: :subtitle, scope: :budget_investment
helper_method :resource_model, :resource_name
respond_to :html, :js
def index
@@ -72,6 +73,14 @@ module Budgets
private
def resource_model
Budget::Investment
end
def resource_name
"budget_investment"
end
def load_investment_votes(investments)
@investment_votes = current_user ? current_user.budget_investment_votes(investments) : {}
end