Simplify method to check an image max size

We were converting megabytes to bytes with the `megabytes` method and
then adding a `bytes_to_megabytes` method to convert it back to bytes,
which is the same as not doing anything at all :).
This commit is contained in:
Javi Martín
2020-04-16 11:57:53 +02:00
parent 2cd4696244
commit ca2dc10ee9

View File

@@ -4,11 +4,7 @@ module ImageablesHelper
end
def imageable_max_file_size
bytes_to_megabytes(Setting["uploads.images.max_size"].to_i.megabytes)
end
def bytes_to_megabytes(bytes)
bytes / Numeric::MEGABYTE
Setting["uploads.images.max_size"].to_i
end
def imageable_accepted_content_types