defcompare_app_version(current, old) returnif current.blank? || old.blank? la = current.split('.') lb = old.split('.') i = 0 if la.length > lb.length len = la.length else len = lb.length end while i <= len do if (la[i] && !lb[i] && la[i].to_i > 0) || (la[i].to_i > lb[i].to_i) return1 elsif (lb[i] && !la[i] && lb[i].to_i > 0) || (la[i].to_i < lb[i].to_i) return -1 end i +=1 end return0 end