Use snake_case for method names

This commit is contained in:
Bertocq
2017-09-14 23:15:19 +02:00
parent 87eeefff41
commit a3428ee589
2 changed files with 3 additions and 3 deletions

View File

@@ -9,7 +9,7 @@ module DocumentablesHelper
end end
def max_file_size(documentable) def max_file_size(documentable)
bytesToMeg(documentable.class.max_file_size) bytes_to_mega(documentable.class.max_file_size)
end end
def accepted_content_types(documentable) def accepted_content_types(documentable)
@@ -38,4 +38,4 @@ module DocumentablesHelper
documentable.documents.count >= documentable.class.max_documents_allowed documentable.documents.count >= documentable.class.max_documents_allowed
end end
end end

View File

@@ -8,7 +8,7 @@ module DocumentsHelper
document.errors[:attachment].join(', ') if document.errors.key?(:attachment) document.errors[:attachment].join(', ') if document.errors.key?(:attachment)
end end
def bytesToMeg(bytes) def bytes_to_mega(bytes)
bytes / Numeric::MEGABYTE bytes / Numeric::MEGABYTE
end end