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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user