Return document max file size in megabytes
The same way it's done for images. We were converting the number of megabytes to bytes and then converting it to megabytes again. Instead, we can leave it as it is and only convert it to bytes when necessary (only one place).
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
class Documents::NestedComponent < ApplicationComponent
|
||||
attr_reader :f
|
||||
delegate :documentable_humanized_accepted_content_types, :max_file_size, to: :helpers
|
||||
delegate :documentable_humanized_accepted_content_types, to: :helpers
|
||||
|
||||
def initialize(f)
|
||||
@f = f
|
||||
@@ -19,7 +19,7 @@ class Documents::NestedComponent < ApplicationComponent
|
||||
def note
|
||||
t "documents.form.note", max_documents_allowed: max_documents_allowed,
|
||||
accepted_content_types: documentable_humanized_accepted_content_types(documentable.class),
|
||||
max_file_size: max_file_size(documentable.class)
|
||||
max_file_size: documentable.class.max_file_size
|
||||
end
|
||||
|
||||
def max_documents_allowed?
|
||||
|
||||
Reference in New Issue
Block a user