Setups in investments controller for Polymorphic concern
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user