paranoia 2.6.1 → 2.6.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7f3f587b5571dc6b69507b4b97de85c0c851bfe248048dbcc2ff792d578ebbca
4
- data.tar.gz: ba5bb9bde79c1be27152df53d2d0be62e852b5e3801cb71d1b2b33fe8bfb9f6b
3
+ metadata.gz: 6f7493c138657c99cbb4eca5ed981c6bfac2400f18d34ad7fda9266ad672c39c
4
+ data.tar.gz: 4397c1ac47d8b67fb3db3a084bdaea2fec4d2ebe5c475c99b2914563e3011ae9
5
5
  SHA512:
6
- metadata.gz: 42caeef276dfc15bcc15ca8fbd2dc8001ca7e24c3577d235d12bfa8cb175b082a4d585c07e4244f2d76acb9c49127c113a7f567bea7c60514a475cf3791ac789
7
- data.tar.gz: 6655a5f44f71fe45e7df8df13545acd8706a8f105bece1e838c77722fbd8fe20ae6596f0e3961976b3bd2a3ed38c5a055230500c30599f8499d845be61c22a60
6
+ metadata.gz: 5acd851f9180575136c06b5e6c44db7a7b53462771d77d722790062ca7e4e2482e2938f35471b54d472f68c1d92b372334b3c269931d997bdd4562c5904ea800
7
+ data.tar.gz: 2efed9b375277b7c1d066499323fe23af8f1af9c139389c45f2688eeb231da1ab8584cd061ba49f66130af4751263eb52458d8d2f68ae1057765437cdc320811
@@ -15,40 +15,32 @@ jobs:
15
15
  strategy:
16
16
  fail-fast: false
17
17
  matrix:
18
- ruby:
19
- - 3.1
20
- - '3.0'
21
- - 2.7
22
- - 2.6
23
- - 2.5
24
- # - jruby-9.2.19.0
25
- # - jruby-9.3.1.0
26
- rails:
27
- - '~> 5.1.0'
28
- - '~> 5.2.0'
29
- - '~> 6.0.0'
30
- - '~> 6.1.0'
31
- - '~> 7.0.0'
32
- - 'edge'
33
- exclude:
34
- # Rails edge is now 7.x and requires ruby 2.7
35
- - rails: 'edge'
36
- ruby: 2.6
37
- - rails: 'edge'
38
- ruby: 2.5
39
- - rails: '~> 7.0.0'
40
- ruby: 2.6
41
- - rails: '~> 7.0.0'
42
- ruby: 2.5
43
- # Legacy Rails with newer rubies
44
- - rails: '~> 5.1.0'
45
- ruby: '3.0'
46
- - rails: '~> 5.2.0'
47
- ruby: '3.0'
48
- - rails: '~> 5.1.0'
49
- ruby: 3.1
50
- - rails: '~> 5.2.0'
51
- ruby: 3.1
18
+ rails: ["~> 7.1.0", "~> 7.0.0", "~> 6.1.0", "~> 6.0.0"]
19
+ ruby: ["3.2.2", "3.1.4", "3.0.6", "2.7.8"]
20
+ include:
21
+ - ruby: 3.2
22
+ rails: 'edge'
23
+ - ruby: 3.2
24
+ rails: '~> 7.1.0'
25
+ # single test failure with jruby
26
+ #- ruby: jruby-9.4
27
+ # rails: '~> 7.0.0'
28
+ - ruby: 2.6
29
+ rails: '~> 6.1.0'
30
+ - ruby: 2.6
31
+ rails: '~> 6.0.0'
32
+ - ruby: 2.6
33
+ rails: '~> 5.2.0'
34
+ - ruby: 2.6
35
+ rails: '~> 5.1.0'
36
+ - ruby: 2.5
37
+ rails: '~> 6.0.0'
38
+ - ruby: 2.5
39
+ rails: '~> 5.2.0'
40
+ - ruby: 2.5
41
+ rails: '~> 5.1.0'
42
+ #os: ubuntu-latest
43
+ #arch: x64
52
44
 
53
45
  env:
54
46
  RAILS: ${{ matrix.rails }}
data/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # paranoia Changelog
2
2
 
3
+ ## 2.6.3
4
+
5
+ * [#548](https://github.com/rubysherpas/paranoia/pull/441) Add support for [Rails 7.1](https://github.com/rails/rails/releases/tag/v7.1.0) (#441)
6
+
7
+ [Indyarocks](https://github.com/indyarocks)
8
+
9
+ ## 2.6.2
10
+
11
+ * [#441](https://github.com/rubysherpas/paranoia/pull/441) Recursive restore with has_many/one through assocs (#441)
12
+ [Emil Ong](https://github.com/emilong)
13
+
3
14
  ## 2.6.1
4
15
 
5
16
  * [#535](https://github.com/rubysherpas/paranoia/pull/535) Allow to skip updating paranoia_destroy_attributes for records while really_destroy!
@@ -1,3 +1,3 @@
1
1
  module Paranoia
2
- VERSION = '2.6.1'.freeze
2
+ VERSION = '2.6.3'.freeze
3
3
  end
data/lib/paranoia.rb CHANGED
@@ -60,7 +60,7 @@ module Paranoia
60
60
  def paranoia_destroy
61
61
  with_transaction_returning_status do
62
62
  result = run_callbacks(:destroy) do
63
- @_disable_counter_cache = deleted?
63
+ @_disable_counter_cache = paranoia_destroyed?
64
64
  result = paranoia_delete
65
65
  next result unless result && ActiveRecord::VERSION::STRING >= '4.2'
66
66
  each_counter_cached_associations do |association|
@@ -73,7 +73,7 @@ module Paranoia
73
73
  @_disable_counter_cache = false
74
74
  result
75
75
  end
76
- raise ActiveRecord::Rollback, "Not destroyed" unless self.deleted?
76
+ raise ActiveRecord::Rollback, "Not destroyed" unless paranoia_destroyed?
77
77
  result
78
78
  end || false
79
79
  end
@@ -216,18 +216,12 @@ module Paranoia
216
216
  end
217
217
 
218
218
  if association_data.nil? && association.macro.to_s == "has_one"
219
- association_class_name = association.klass.name
220
- association_foreign_key = association.foreign_key
221
-
222
- if association.type
223
- association_polymorphic_type = association.type
224
- association_find_conditions = { association_polymorphic_type => self.class.name.to_s, association_foreign_key => self.id }
225
- else
219
+ association_class = association.klass
220
+ if association_class.paranoid?
221
+ association_foreign_key = association.options[:through].present? ? association.klass.primary_key : association.foreign_key
226
222
  association_find_conditions = { association_foreign_key => self.id }
227
- end
223
+ association_find_conditions[association.type] = self.class.name if association.type
228
224
 
229
- association_class = association_class_name.constantize
230
- if association_class.paranoid?
231
225
  association_class.only_deleted.where(association_find_conditions).first
232
226
  .try!(:restore, recursive: true, :recovery_window_range => recovery_window_range)
233
227
  end
data/paranoia.gemspec CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
11
11
  s.license = 'MIT'
12
12
  s.summary = "Paranoia is a re-implementation of acts_as_paranoid for Rails 3, 4, and 5, using much, much, much less code."
13
13
  s.description = <<-DSC
14
- Paranoia is a re-implementation of acts_as_paranoid for Rails 4, 5, 6, and 7,
14
+ Paranoia is a re-implementation of acts_as_paranoid for Rails 5, 6, and 7,
15
15
  using much, much, much less code. You would use either plugin / gem if you
16
16
  wished that when you called destroy on an Active Record object that it
17
17
  didn't actually destroy it, but just "hid" the record. Paranoia does this
@@ -24,7 +24,7 @@ Gem::Specification.new do |s|
24
24
 
25
25
  s.required_ruby_version = '>= 2.5'
26
26
 
27
- s.add_dependency 'activerecord', '>= 5.1', '< 7.1'
27
+ s.add_dependency 'activerecord', '>= 5.1', '< 7.2'
28
28
 
29
29
  s.add_development_dependency "bundler", ">= 1.0.0"
30
30
  s.add_development_dependency "rake"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paranoia
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.1
4
+ version: 2.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - radarlistener@gmail.com
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-15 00:00:00.000000000 Z
11
+ date: 2023-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '5.1'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '7.1'
22
+ version: '7.2'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '5.1'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '7.1'
32
+ version: '7.2'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: bundler
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -59,7 +59,7 @@ dependencies:
59
59
  - !ruby/object:Gem::Version
60
60
  version: '0'
61
61
  description: |2
62
- Paranoia is a re-implementation of acts_as_paranoid for Rails 4, 5, 6, and 7,
62
+ Paranoia is a re-implementation of acts_as_paranoid for Rails 5, 6, and 7,
63
63
  using much, much, much less code. You would use either plugin / gem if you
64
64
  wished that when you called destroy on an Active Record object that it
65
65
  didn't actually destroy it, but just "hid" the record. Paranoia does this
@@ -106,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
106
  - !ruby/object:Gem::Version
107
107
  version: 1.3.6
108
108
  requirements: []
109
- rubygems_version: 3.4.0.dev
109
+ rubygems_version: 3.4.18
110
110
  signing_key:
111
111
  specification_version: 4
112
112
  summary: Paranoia is a re-implementation of acts_as_paranoid for Rails 3, 4, and 5,