Views and helpers refactor

This commit is contained in:
Senén Rodero Rodríguez
2017-08-25 12:08:46 +02:00
parent d67ad6d6d0
commit b2a6189cf5
6 changed files with 76 additions and 52 deletions

View File

@@ -34,4 +34,8 @@ module DocumentablesHelper
max_file_size: max_file_size(documentable)
end
def max_documents_allowed?(documentable)
documentable.documents.count >= documentable.class.max_documents_allowed
end
end