acts_as_paranoid 0.10.0 → 0.10.1

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: 992c8836d7fa518c06baf1be695fcad08a9f9332cbd25596041cdbcf7c61d525
4
- data.tar.gz: 2deedb7d195a333cd869b60ada4fe9f91c3d68005a04470e5fb97115c3acb748
3
+ metadata.gz: 45d8ec4adf62543fc1eaba6560fde9b075ecf0fef95b8e2d2811ee08a9093d24
4
+ data.tar.gz: 51da12bf09c6d0aab09d835d44aa7a74e617ad5f31b0a624af32148ffb63b17c
5
5
  SHA512:
6
- metadata.gz: 120588d3f6db69ca22c70d554bb82fcad1fe6471e411df9711ba111ea8b63aba93fa312b60216fd033457e6ff6f9b2d8bbc2cd5d8ca276e0c0b1d3a4b6d5a159
7
- data.tar.gz: 73eee9f04521fb530034d81dcdbe41a3bf8c84f83f0dfa37db26f38d8a66d89c681d0ba0cbf6aae2f3cb3fb5c0588678ea6de506137983ab9c07a5d5e2d637b7
6
+ metadata.gz: d419f338d8ab828856188404eb2c1f84f31508af15cae65fee647c050ed1efbe41f69951ebf0f3e9de69a5416b0ff7157fb3ad999642eae0dc4dc804fce59634
7
+ data.tar.gz: 236842d046c63ac8b0efedf5937911ddca18a7232006d7459fb19027902ef38534b70a32c674916972c9b7aec08b1c6f109e6c07979b1de1afdf88a7c6a45094
data/CHANGELOG.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  Notable changes to this project will be documented in this file.
4
4
 
5
+ ## 0.10.1
6
+
7
+ * Add changelog_uri to gemspec ([#332] by [fynsta])
8
+ * Improve contribution instructions ([#338] by [mvz])
9
+ * Make with_deleted work with paranoid join records ([#339] by [mvz])
10
+
11
+ [fynsta]: https://github.com/fynsta
12
+
13
+ [#332]: https://github.com/ActsAsParanoid/acts_as_paranoid/pull/332
14
+ [#338]: https://github.com/ActsAsParanoid/acts_as_paranoid/pull/338
15
+ [#339]: https://github.com/ActsAsParanoid/acts_as_paranoid/pull/339
16
+
5
17
  ## 0.10.0
6
18
 
7
19
  * Support Ruby 3.0 through 3.3, dropping support for 2.7 ([#322] by [mvz])
data/CONTRIBUTING.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Contributing to ActsAsParanoid
2
2
 
3
- We welcome all contributions to ActsAsParanoid. Below are some guidelines to
4
- help the process of handling issues and pull requests go smoothly.
3
+ We welcome contributions to ActsAsParanoid. Please follow the guidelines below to help the
4
+ process of handling issues and pull requests go smoothly.
5
5
 
6
6
  ## Issues
7
7
 
@@ -14,30 +14,35 @@ ticket.
14
14
  - Describe what you are trying to achieve
15
15
  - Describe what you did, preferably including relevant code
16
16
  - Describe what you expected to happen
17
- - Describe what happened instead, possibly including relevant output
17
+ - Describe what happened instead. Include relevant output if possible
18
+ - State the version of ActsAsParanoid you are using
18
19
  - Use [code blocks](https://github.github.com/gfm/#fenced-code-blocks) to
19
20
  format any code and output in your ticket to make it readable.
20
21
 
21
- ## Pull requests
22
+ ## Pull Requests
22
23
 
23
24
  If you have an idea for a particular feature, it's probably best to create a
24
25
  GitHub issue for it before trying to implement it yourself. That way, we can
25
26
  discuss the feature and whether it makes sense to include in ActsAsParanoid itself
26
27
  before putting in the work to implement it.
27
28
 
28
- To send pull requests or patches, please follow the instructions below.
29
- **If you get stuck, please make a pull request anyway and we'll try to
30
- help out.**
29
+ When sending a pull request, please follow **all of** the instructions below:
31
30
 
32
- - Make sure `bundle exec rake` runs without reporting any failures.
33
- - Add tests for your feature. Otherwise, we can't see if it works or if we
34
- break it later.
31
+ - Make sure `bundle exec rake` runs without reporting any failures. See
32
+ *Testing your changes* below for more details.
33
+ - Add tests for your feature. Otherwise, we can't see if it works or if
34
+ we break it later.
35
35
  - Create a separate branch for your feature based off of latest master.
36
+ - Write [good commit messages](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).
36
37
  - Do not include changes that are irrelevant to your feature in the same
37
38
  commit.
38
39
  - Keep an eye on the build results in GitHub Actions. If the build fails and it
39
40
  seems due to your changes, please update your pull request with a fix.
40
41
 
42
+ If you're not sure how to test the problem, or what the best solution is, or
43
+ get stuck on something else, please open an issue first so that we can discuss
44
+ the best approach.
45
+
41
46
  ### Testing your changes
42
47
 
43
48
  You can run the test suite with the latest version of all dependencies by running the following:
@@ -62,9 +67,10 @@ documentation for details.
62
67
  that just fix a mistake in a previous commits, we will ask you to clean up
63
68
  the history.
64
69
  Again, [the git-rebase guide](https://git-rebase.io/) should help out.
65
- - At the end of the review process we may still choose not to merge your pull
66
- request. For example, this could happen if we decide the proposed feature
70
+ Note that we will not squash-merge pull requests, since that results in a loss of history.
71
+ - **At the end of the review process we may still choose not to merge your pull
72
+ request.** For example, this could happen if we decide the proposed feature
67
73
  should not be part of ActsAsParanoid, or if the technical implementation does not
68
- match where we want to go with the architecture the project.
74
+ match where we want to go with the architecture of the project.
69
75
  - We will generally not merge any pull requests that make the build fail, unless
70
76
  it's very clearly not related to the changes in the pull request.
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActsAsParanoid
4
+ # This module is included in ActiveRecord::Base to provide paranoid associations.
4
5
  module Associations
5
6
  def self.included(base)
6
7
  base.extend ClassMethods
@@ -118,13 +118,10 @@ module ActsAsParanoid
118
118
  def without_paranoid_default_scope
119
119
  scope = all
120
120
 
121
- # unscope avoids applying the default scope when using this scope for associations
122
- scope = scope.unscope(where: paranoid_column)
123
-
124
- paranoid_where_clause =
125
- ActiveRecord::Relation::WhereClause.new([paranoid_default_scope])
126
-
127
- scope.where_clause = all.where_clause - paranoid_where_clause
121
+ unless scope.unscope_values.include?({ where: paranoid_column })
122
+ # unscope avoids applying the default scope when using this scope for associations
123
+ scope = scope.unscope(where: paranoid_column)
124
+ end
128
125
 
129
126
  scope
130
127
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActsAsParanoid
4
- VERSION = "0.10.0"
4
+ VERSION = "0.10.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts_as_paranoid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zachary Scott
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2024-05-17 00:00:00.000000000 Z
13
+ date: 2024-07-28 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activerecord
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '5.14'
83
+ - !ruby/object:Gem::Dependency
84
+ name: minitest-around
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '0.5'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '0.5'
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: minitest-focus
85
99
  requirement: !ruby/object:Gem::Requirement
@@ -94,6 +108,20 @@ dependencies:
94
108
  - - "~>"
95
109
  - !ruby/object:Gem::Version
96
110
  version: '1.3'
111
+ - !ruby/object:Gem::Dependency
112
+ name: minitest-stub-const
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '0.6'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '0.6'
97
125
  - !ruby/object:Gem::Dependency
98
126
  name: pry
99
127
  requirement: !ruby/object:Gem::Requirement
@@ -256,6 +284,7 @@ homepage: https://github.com/ActsAsParanoid/acts_as_paranoid
256
284
  licenses:
257
285
  - MIT
258
286
  metadata:
287
+ changelog_uri: https://github.com/ActsAsParanoid/acts_as_paranoid/blob/master/CHANGELOG.md
259
288
  rubygems_mfa_required: 'true'
260
289
  post_install_message:
261
290
  rdoc_options: []
@@ -272,7 +301,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
272
301
  - !ruby/object:Gem::Version
273
302
  version: '0'
274
303
  requirements: []
275
- rubygems_version: 3.5.10
304
+ rubygems_version: 3.5.16
276
305
  signing_key:
277
306
  specification_version: 4
278
307
  summary: Active Record plugin which allows you to hide and restore records without