Add arguments to documentable concern to make it configurable for any recipient model.

This commit is contained in:
Senén Rodero Rodríguez
2017-07-21 19:48:57 +02:00
parent 62372aaee3
commit 38d4d59241
11 changed files with 78 additions and 22 deletions

View File

@@ -4,7 +4,7 @@
<div class="small-12 medium-9 column">
<%= back_link_to budget_investments_path(investment.budget, heading_id: investment.heading) %>
<% if can?(:create, @document) && investment.documents.size < Budget::Investment::MAX_DOCUMENTS_SIZE %>
<% if can?(:create, @document) && investment.documents.size < Budget::Investment.max_documents_allowed %>
<%= link_to t("documents.upload_document"),
new_document_path(documentable_id:investment, documentable_type: investment.class.name, from: request.url),
class: 'button hollow float-right' %>

View File

@@ -23,7 +23,7 @@
<div class="tabs-panel" id="tab-documents">
<%= render 'documents/documents',
documents: @investment.documents,
max_documents_size: Budget::Investment::MAX_DOCUMENTS_SIZE %>
max_documents_allowed: Budget::Investment.max_documents_allowed %>
</div>
</div>