From 8df7d48f3a940b67f19c771632ad12877e1e6b6a Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Mar 28 2019 17:19:25 +0000 Subject: Update to Active Record 5.2.3. --- diff --git a/rubygem-activerecord-5.2.2-fix-Ruby26-compatibility-tests.patch b/rubygem-activerecord-5.2.2-fix-Ruby26-compatibility-tests.patch deleted file mode 100644 index 1909a68..0000000 --- a/rubygem-activerecord-5.2.2-fix-Ruby26-compatibility-tests.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 6ea356e9781e7696c48a3f9fc3ecbb0ddda5f198 Mon Sep 17 00:00:00 2001 -From: Vladimir Dementyev -Date: Wed, 2 Jan 2019 17:55:48 -0500 -Subject: [PATCH] fix activerecord reaper_test - ---- - activerecord/test/cases/reaper_test.rb | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/activerecord/test/cases/reaper_test.rb b/activerecord/test/cases/reaper_test.rb -index b630f782bc5b..402ddcf05a0b 100644 ---- a/activerecord/test/cases/reaper_test.rb -+++ b/activerecord/test/cases/reaper_test.rb -@@ -48,7 +48,7 @@ def test_some_time - - reaper = ConnectionPool::Reaper.new(fp, 0.0001) - reaper.run -- until fp.reaped -+ until fp.flushed - Thread.pass - end - assert fp.reaped diff --git a/rubygem-activerecord-5.2.2-fix-Ruby26-compatibility.patch b/rubygem-activerecord-5.2.2-fix-Ruby26-compatibility.patch deleted file mode 100644 index c706e8b..0000000 --- a/rubygem-activerecord-5.2.2-fix-Ruby26-compatibility.patch +++ /dev/null @@ -1,26 +0,0 @@ -From d237c7c72ccfd87302983669f83c8c90d2aec82e Mon Sep 17 00:00:00 2001 -From: Alberto Almagro -Date: Fri, 4 Jan 2019 00:27:12 +0100 -Subject: [PATCH 2/2] Make average compatible accross Ruby versions - -Since Ruby 2.6.0 NilClass#to_d is returning `BigDecimal` 0.0, this -breaks `average` compatibility with prior Ruby versions. This patch -makes `average` return `nil` in all Ruby versions when there are no -rows. ---- - activerecord/lib/active_record/relation/calculations.rb | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/activerecord/lib/active_record/relation/calculations.rb b/activerecord/lib/active_record/relation/calculations.rb -index 3ef6e7928fcf..c2c4a5a88244 100644 ---- a/activerecord/lib/active_record/relation/calculations.rb -+++ b/activerecord/lib/active_record/relation/calculations.rb -@@ -401,7 +401,7 @@ def type_cast_calculated_value(value, type, operation = nil) - case operation - when "count" then value.to_i - when "sum" then type.deserialize(value || 0) -- when "average" then value.respond_to?(:to_d) ? value.to_d : value -+ when "average" then value&.respond_to?(:to_d) ? value.to_d : value - else type.deserialize(value) - end - end diff --git a/rubygem-activerecord.spec b/rubygem-activerecord.spec index bd9064b..f3b5faf 100644 --- a/rubygem-activerecord.spec +++ b/rubygem-activerecord.spec @@ -3,7 +3,7 @@ Name: rubygem-%{gem_name} Epoch: 1 -Version: 5.2.2.1 +Version: 5.2.3 Release: 1%{?dist} Summary: Object-relational mapper framework (part of Rails) License: MIT @@ -11,15 +11,9 @@ URL: http://rubyonrails.org Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem # git clone http://github.com/rails/rails.git # cd rails/activerecord/ -# git checkout v5.2.2.1 && tar czvf activerecord-5.2.2.1-tests.tgz test/ +# git checkout v5.2.3 && tar czvf activerecord-5.2.3-tests.tgz test/ Source1: activerecord-%{version}-tests.tgz -# Backport upstream patches for Ruby 2.6 compatibility -# https://github.com/rails/rails/pull/34858 -# https://github.com/rails/rails/commit/6ea356e9781e7696c48a3f9fc3ecbb0ddda5f198 -Patch0: rubygem-activerecord-5.2.2-fix-Ruby26-compatibility.patch -Patch1: rubygem-activerecord-5.2.2-fix-Ruby26-compatibility-tests.patch - # Database dump/load reuires the executable. Suggests: %{_bindir}/sqlite3 BuildRequires: rubygems-devel @@ -51,8 +45,6 @@ Documentation for %{name}. %prep %setup -q -n %{gem_name}-%{version} -%patch0 -p2 - %build gem build ../%{gem_name}-%{version}.gemspec %gem_install @@ -106,6 +98,9 @@ popd %{gem_instdir}/examples %changelog +* Thu Mar 28 2019 Pavel Valena - 1:5.2.3-1 +- Update to Active Record 5.2.3. + * Thu Mar 14 2019 Pavel Valena - 1:5.2.2.1-1 - Update to Active Record 5.2.2.1. diff --git a/sources b/sources index a011737..6598c7f 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (activerecord-5.2.2.1.gem) = b9234594ec3e8a295a03ceef1d15f2caa16d6ebd9e9b512ca4020984060f52699f75ffd22b0a555c79859e844c121ab9d2128a70ad27241948346a10ff88604b -SHA512 (activerecord-5.2.2.1-tests.tgz) = d60e1e5c62a641b9c498cba731bba5383989261ce38512767eadc92be4144f7871d815dc4f05407342650efe1b2c3651b995a7b9a39594bfc0e95b40ed08b830 +SHA512 (activerecord-5.2.3.gem) = 838d2fa5ec29022683b94173015e7db672a147305a6dd7745120a66ff4626af9ce3d746a73ac0b918d32af9e069831aa43358e99edd996fa23ebc2517a338b65 +SHA512 (activerecord-5.2.3-tests.tgz) = 76c806ee172c5009d6d8dab21078bc4d8c0e5eca6cffdb17d3378d30a53dc5e2cf702646ec3ff1edb00395bddc48ff3d66e74048dbb27ed3784589309bc75383