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

@@ -16,7 +16,7 @@
<div class="small-12 medium-9 column">
<%= back_link_to %>
<% if can?(:create, @document) && @proposal.documents.size < Proposal::MAX_DOCUMENTS_SIZE %>
<% if can?(:create, @document) && @proposal.documents.size < Proposal.max_documents_allowed %>
<%= link_to t("documents.upload_document"),
new_document_path(documentable_id: @proposal, documentable_type: @proposal.class.name, from: request.url),
class: 'button hollow float-right' %>
@@ -166,6 +166,6 @@
<div class="tabs-panel" id="tab-documents">
<%= render 'documents/documents',
documents: @proposal.documents,
max_documents_size: Proposal::MAX_DOCUMENTS_SIZE %>
max_documents_allowed: Proposal.max_documents_allowed %>
</div>
</div>