From 531a229bf6ae18adb01d46f2283f8c6bedaaefc3 Mon Sep 17 00:00:00 2001 From: Jun Aruga Date: Fri, 15 Feb 2019 15:25:47 +0100 Subject: [PATCH 01/10] Add Ruby 2.6 to Travis CI. --- .travis.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8828fbfa..3c4f15b6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,9 +4,10 @@ before_install: gem update --system cache: bundler rvm: - 2.2 - - 2.3.5 - - 2.4.3 - - 2.5.0 + - 2.3.8 + - 2.4.5 + - 2.5.3 + - 2.6.1 - jruby-9.1.6.0 env: From b9583d2d887ac396b0d702ab55d61605f9f99f9f Mon Sep 17 00:00:00 2001 From: Anton Kolodii Date: Wed, 17 Oct 2018 13:59:45 +0300 Subject: [PATCH 02/10] Remove upper dependency for activerecord We are trying to test our application on rails 6.0.0.alpha but we can't install this because of the version lock Probably this will be helpful that we can try and report any issues with edge rails --- .travis.yml | 8 ++++++++ Gemfile | 8 ++++++-- lib/paranoia.rb | 5 +++-- paranoia.gemspec | 2 +- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3c4f15b6..5906dfb8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,6 +16,7 @@ env: - RAILS='~> 5.0.0' - RAILS='~> 5.1.0' - RAILS='~> 5.2.0' + - RAILS='master' matrix: allow_failures: @@ -27,3 +28,10 @@ matrix: rvm: jruby-9.1.6.0 - env: RAILS='~> 5.2.0' rvm: jruby-9.1.6.0 + - env: RAILS='master' + rvm: jruby-9.1.6.0 + exclude: + - rvm: 2.2 + env: RAILS='master' + - rvm: 2.3.5 + env: RAILS='master' diff --git a/Gemfile b/Gemfile index fbc29caa..de9b59ea 100644 --- a/Gemfile +++ b/Gemfile @@ -7,14 +7,18 @@ platforms :jruby do end platforms :rbx do + gem 'rubinius-developer_tools' gem 'rubysl', '~> 2.0' gem 'rubysl-test-unit' - gem 'rubinius-developer_tools' end rails = ENV['RAILS'] || '~> 5.2.0' -gem 'rails', rails +if rails == 'master' + gem 'rails', github: 'rails/rails' +else + gem 'rails', rails +end # Specify your gem's dependencies in paranoia.gemspec gemspec diff --git a/lib/paranoia.rb b/lib/paranoia.rb index 4ba4c389..c1b323fc 100644 --- a/lib/paranoia.rb +++ b/lib/paranoia.rb @@ -1,6 +1,7 @@ require 'active_record' unless defined? ActiveRecord -if [ActiveRecord::VERSION::MAJOR, ActiveRecord::VERSION::MINOR] == [5, 2] +if [ActiveRecord::VERSION::MAJOR, ActiveRecord::VERSION::MINOR] == [5, 2] || + ActiveRecord::VERSION::MAJOR > 5 require 'paranoia/active_record_5_2' end @@ -305,7 +306,7 @@ def build_relation(klass, *args) class UniquenessValidator < ActiveModel::EachValidator prepend UniquenessParanoiaValidator end - + class AssociationNotSoftDestroyedValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) # if association is soft destroyed, add an error diff --git a/paranoia.gemspec b/paranoia.gemspec index 18a9768f..a72c027a 100644 --- a/paranoia.gemspec +++ b/paranoia.gemspec @@ -24,7 +24,7 @@ Gem::Specification.new do |s| s.required_ruby_version = '>= 2.0' - s.add_dependency 'activerecord', '>= 4.0', '< 5.3' + s.add_dependency 'activerecord', '>= 4.0' s.add_development_dependency "bundler", ">= 1.0.0" s.add_development_dependency "rake" From 7ed561c693d203ddb8bdabfdb31bd2cb1a87a4dc Mon Sep 17 00:00:00 2001 From: Anton Kolodii Date: Wed, 13 Feb 2019 12:29:46 +0200 Subject: [PATCH 03/10] Remove back upper limit --- paranoia.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paranoia.gemspec b/paranoia.gemspec index a72c027a..9e401e99 100644 --- a/paranoia.gemspec +++ b/paranoia.gemspec @@ -24,7 +24,7 @@ Gem::Specification.new do |s| s.required_ruby_version = '>= 2.0' - s.add_dependency 'activerecord', '>= 4.0' + s.add_dependency 'activerecord', '>= 4.0', '< 6.1' s.add_development_dependency "bundler", ">= 1.0.0" s.add_development_dependency "rake" From e09868038c8635c506196fd8cd29a3a76b9b7099 Mon Sep 17 00:00:00 2001 From: Anton Kolodii Date: Wed, 13 Feb 2019 12:31:05 +0200 Subject: [PATCH 04/10] Update .travis.yml --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 5906dfb8..d485aee7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,3 +35,5 @@ matrix: env: RAILS='master' - rvm: 2.3.5 env: RAILS='master' + - rvm: 2.4.3 + env: RAILS='master' From b443fd95bfb9482305593081692135f6df9ae639 Mon Sep 17 00:00:00 2001 From: Jared Norman Date: Mon, 22 Apr 2019 03:20:47 +0000 Subject: [PATCH 05/10] Allow specifying sqlite version Older versions of activerecord require sqlite ~> 1.3.6, but not in the gemfile, the constraint is enforced when you load the adapter. This allows us toe specify in the environment the version of the gem we'd like to run against. --- Gemfile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index de9b59ea..6c061d29 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,12 @@ source 'https://rubygems.org' -gem 'sqlite3', platforms: [:ruby] +sqlite = ENV['SQLITE_VERSION'] + +if sqlite + gem 'sqlite3', sqlite, platforms: [:ruby] +else + gem 'sqlite3', platforms: [:ruby] +end platforms :jruby do gem 'activerecord-jdbcsqlite3-adapter' From 64f6c2df6b2c41d56dbf41fa7b9074262304a122 Mon Sep 17 00:00:00 2001 From: Jared Norman Date: Mon, 22 Apr 2019 03:22:56 +0000 Subject: [PATCH 06/10] Specify compatible sqlite versions for older rails These versions of rails enforce this version constraint when loading the sqlite adapter so we need to make sure that we always use a compatible version. --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index d485aee7..4dcc3ba9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,8 +12,8 @@ rvm: env: matrix: - - RAILS='~> 4.2.0' - - RAILS='~> 5.0.0' + - RAILS='~> 4.2.0' SQLITE_VERSION='~> 1.3.6' + - RAILS='~> 5.0.0' SQLITE_VERSION='~> 1.3.6' - RAILS='~> 5.1.0' - RAILS='~> 5.2.0' - RAILS='master' From 37c7aa8c7ca9726781e69c51b386ade2281840a1 Mon Sep 17 00:00:00 2001 From: Jared Norman Date: Mon, 22 Apr 2019 03:35:13 +0000 Subject: [PATCH 07/10] Correct excluded Ruby versions The versions we were running against were bumped, so we needed to update which versions were being excluded as they were stale. Rails master (soon to be 6.0.0) doesn't support versions before Ruby 2.5. --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4dcc3ba9..1c531896 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,7 +33,7 @@ matrix: exclude: - rvm: 2.2 env: RAILS='master' - - rvm: 2.3.5 + - rvm: 2.3.8 env: RAILS='master' - - rvm: 2.4.3 + - rvm: 2.4.5 env: RAILS='master' From 26383fc724cc2da5d62e3626e4234592cc940a51 Mon Sep 17 00:00:00 2001 From: Jared Norman Date: Mon, 22 Apr 2019 04:14:29 +0000 Subject: [PATCH 08/10] fixup! Specify compatible sqlite versions for older rails --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1c531896..f78bf107 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,9 +20,9 @@ env: matrix: allow_failures: - - env: RAILS='~> 4.2.0' + - env: RAILS='~> 4.2.0' SQLITE_VERSION='~> 1.3.6' rvm: jruby-9.1.6.0 - - env: RAILS='~> 5.0.0' + - env: RAILS='~> 5.0.0' SQLITE_VERSION='~> 1.3.6' rvm: jruby-9.1.6.0 - env: RAILS='~> 5.1.0' rvm: jruby-9.1.6.0 From c9b1c8a1d82247e243439ccd1e53aac4b17d1333 Mon Sep 17 00:00:00 2001 From: Jared Norman Date: Mon, 22 Apr 2019 04:15:58 +0000 Subject: [PATCH 09/10] Run tests against latest Ruby 2.6 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f78bf107..78b46b95 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ rvm: - 2.3.8 - 2.4.5 - 2.5.3 - - 2.6.1 + - 2.6.3 - jruby-9.1.6.0 env: From 0600183a12b1e0c5d74d94000bee08d5fc4a5933 Mon Sep 17 00:00:00 2001 From: John Hawthorn Date: Thu, 25 Apr 2019 18:17:53 -0700 Subject: [PATCH 10/10] Version 2.4.2 --- CHANGELOG.md | 6 ++++++ lib/paranoia/version.rb | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35d25547..08ac9d61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # paranoia Changelog +## 2.4.2 + +* [#470](https://github.com/rubysherpas/paranoia/pull/470) Add support for ActiveRecord 6.0 + + [Anton Kolodii](https://github.com/iggant), [Jared Norman](https://github.com/jarednorman) + ## 2.4.1 * [#435](https://github.com/rubysherpas/paranoia/pull/435) Monkeypatch activerecord relations to work with rails 5.2.0 diff --git a/lib/paranoia/version.rb b/lib/paranoia/version.rb index 1b2fb121..046171d6 100644 --- a/lib/paranoia/version.rb +++ b/lib/paranoia/version.rb @@ -1,3 +1,3 @@ module Paranoia - VERSION = '2.4.1'.freeze + VERSION = '2.4.2'.freeze end