Add nested documents to new budgetinvestments.

This commit is contained in:
Senén Rodero Rodríguez
2017-08-24 00:40:12 +02:00
parent d34216b5a7
commit 4081dded5f
6 changed files with 28 additions and 8 deletions

View File

@@ -49,6 +49,7 @@ module Budgets
def create
@investment.author = current_user
recover_documents_from_cache(@investment)
if @investment.save
Mailer.budget_investment_created(@investment).deliver_later
@@ -105,7 +106,8 @@ module Budgets
def investment_params
params.require(:budget_investment).permit(:title, :description, :external_url, :heading_id, :tag_list,
:organization_name, :location, :terms_of_service)
:organization_name, :location, :terms_of_service,
documents_attributes: [:id, :title, :attachment, :cached_attachment, :user_id])
end
def load_ballot