From 30f82f17f6c0c01baf88e14f7aa735c284f65ac2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=CC=88rg=20Schiller?= Date: Fri, 11 Dec 2020 22:52:23 +0100 Subject: [PATCH 1/2] Bump activerecord dependency --- .travis.yml | 7 +++++++ paranoia.gemspec | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8beed5a5..abaa5b55 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,6 +17,7 @@ env: - RAILS='~> 5.0.0' SQLITE_VERSION='~> 1.3.6' - RAILS='~> 5.1.0' - RAILS='~> 5.2.0' + - RAILS='~> 6.1.0' - RAILS='master' matrix: @@ -31,8 +32,14 @@ matrix: rvm: jruby-9.2.8.0 - env: RAILS='master' rvm: jruby-9.2.8.0 + - env: RAILS='~> 6.1.0' + rvm: jruby-9.2.8.0 exclude: - rvm: 2.3.8 env: RAILS='master' - rvm: 2.4.5 env: RAILS='master' + - rvm: 2.3.8 + env: RAILS='~> 6.1.0' + - rvm: 2.4.5 + env: RAILS='~> 6.1.0' diff --git a/paranoia.gemspec b/paranoia.gemspec index 9e401e99..6a5b4303 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', '< 6.1' + s.add_dependency 'activerecord', '>= 4.0', '< 6.2' s.add_development_dependency "bundler", ">= 1.0.0" s.add_development_dependency "rake" From f504fc9ea7ea1c15142b0204fc198a3a074006aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=CC=88rg=20Schiller?= Date: Fri, 11 Dec 2020 22:54:10 +0100 Subject: [PATCH 2/2] Avoid deprecated method to add error Calling `<<` to an ActiveModel::Errors message array in order to add an error is deprecated. Please call `ActiveModel::Errors#add` instead. --- lib/paranoia.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/paranoia.rb b/lib/paranoia.rb index 7aac0390..13b38ab3 100644 --- a/lib/paranoia.rb +++ b/lib/paranoia.rb @@ -316,7 +316,7 @@ class AssociationNotSoftDestroyedValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) # if association is soft destroyed, add an error if value.present? && value.paranoia_destroyed? - record.errors[attribute] << 'has been soft-deleted' + record.errors.add(attribute, 'has been soft-deleted') end end end