diff --git a/app/helpers/documentables_helper.rb b/app/helpers/documentables_helper.rb index be827159d..74d7ccf0d 100644 --- a/app/helpers/documentables_helper.rb +++ b/app/helpers/documentables_helper.rb @@ -8,7 +8,7 @@ module DocumentablesHelper end def max_file_size(documentable_class) - bytes_to_mega(documentable_class.max_file_size) + documentable_class.max_file_size / Numeric::MEGABYTE end def accepted_content_types(documentable_class) diff --git a/app/helpers/documents_helper.rb b/app/helpers/documents_helper.rb index 1200b418a..0a57b7299 100644 --- a/app/helpers/documents_helper.rb +++ b/app/helpers/documents_helper.rb @@ -7,10 +7,6 @@ module DocumentsHelper document.errors[:attachment].join(", ") if document.errors.key?(:attachment) end - def bytes_to_mega(bytes) - bytes / Numeric::MEGABYTE - end - def render_destroy_document_link(builder, document) if !document.persisted? && document.cached_attachment.present? link_to t("documents.form.delete_button"), diff --git a/spec/shared/models/document_validations.rb b/spec/shared/models/document_validations.rb index 9ef685d6f..1a9a59a56 100644 --- a/spec/shared/models/document_validations.rb +++ b/spec/shared/models/document_validations.rb @@ -1,5 +1,4 @@ shared_examples "document validations" do |documentable_factory| - include DocumentsHelper include DocumentablesHelper let!(:document) { build(:document, documentable_factory.to_sym) }