From ca1a4db299cd7943bc0d2cc24b4e6dd79a9e4219 Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Tue, 1 Dec 2020 15:16:39 +0000 Subject: [PATCH 1/2] Bump to ruby 2.4.4 --- .ruby-version | 2 +- Gemfile | 2 +- Gemfile.lock | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.ruby-version b/.ruby-version index 00355e29d1..79a614418f 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.3.7 +2.4.4 diff --git a/Gemfile b/Gemfile index 59b5dcf62a..3fefa56bbc 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,5 @@ source 'https://rubygems.org' -ruby "2.3.7" +ruby "2.4.4" git_source(:github) { |repo_name| "https://github.com/#{repo_name}.git" } gem 'i18n' diff --git a/Gemfile.lock b/Gemfile.lock index ff721252e8..f4e59c0975 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -842,7 +842,7 @@ DEPENDENCIES wkhtmltopdf-binary RUBY VERSION - ruby 2.3.7p456 + ruby 2.4.4p296 BUNDLED WITH 1.17.3 From b76261c61cc5d64a2db2ec9896ad2c7615530122 Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Sat, 12 Dec 2020 18:50:57 +0000 Subject: [PATCH 2/2] Adapt preferable to work with new BigDecimal version BigDecimal raises exception if called with nil or empty values --- app/models/spree/preferences/preferable.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/spree/preferences/preferable.rb b/app/models/spree/preferences/preferable.rb index 91a14256af..34cf69e193 100644 --- a/app/models/spree/preferences/preferable.rb +++ b/app/models/spree/preferences/preferable.rb @@ -115,6 +115,7 @@ module Spree when :password value.to_s when :decimal + value = 0 if value.blank? BigDecimal(value.to_s).round(2, BigDecimal::ROUND_HALF_UP) when :integer value.to_i