From a564ec62b5edbcc2ae9d4ed80584eeeb1feaa6c2 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 14 Jan 2020 16:16:25 +0100 Subject: [PATCH] updated version check worker --- app/workers/version_check_worker.rb | 10 +++++++++- package.json | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/workers/version_check_worker.rb b/app/workers/version_check_worker.rb index 1632d590c..820670cfd 100644 --- a/app/workers/version_check_worker.rb +++ b/app/workers/version_check_worker.rb @@ -9,7 +9,15 @@ class VersionCheckWorker res = FabHub.fab_manager_version_check setting_ver = Setting.find_or_initialize_by(name: 'hub_last_version') - setting_ver.value = { version: res['last_version']['semver'], security: res['last_version']['security'], status: res['up_to_date'] }.to_json.to_s + value = { + security: res['status']['security'], + up_to_date: res['status']['up_to_date'] + } + if res['upgrade_to'] + value['version'] = res['upgrade_to']['semver'] + value['url'] = res['upgrade_to']['url'] + end + setting_ver.value = value.to_json.to_s setting_ver.save! setting_key = Setting.find_or_initialize_by(name: 'hub_public_key') diff --git a/package.json b/package.json index 1344f2e24..69469d307 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fab-manager", - "version": "4.3.0-dev", + "version": "4.0.0-dev", "description": "FabManager is the FabLab management solution. It provides a comprehensive, web-based, open-source tool to simplify your administrative tasks and your marker's projects.", "keywords": [ "fablab",