Fix Version field interpreting ints as BigDecimal

In some cases the "version" var would be a BigDecimal. This led to
1) versions being displayed as "1.0.2.0" instead of "1.2", and 2) versions with letters (e.g A.0) leading to a 500 error, as BigDecimal#chr doesn't exist
This commit is contained in:
Patrick Skillen 2021-05-06 11:29:54 +01:00
parent 14170ab337
commit 3c66c315c1

View File

@ -207,6 +207,7 @@ module DmsfUploadHelper
# 1 -> 1, -65 -> A
def self.gui_version(version)
version = version.to_i # catch the case where version is a BigDecimal
return version if version >= 0
(-version).chr
end