zombie_record 1.4.2 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +58 -0
- data/.gitignore +1 -1
- data/CHANGELOG.md +13 -0
- data/README.md +1 -1
- data/Rakefile +0 -6
- data/gemfiles/rails5.0.gemfile +1 -0
- data/gemfiles/rails5.1.gemfile +1 -0
- data/gemfiles/rails5.2.gemfile +1 -0
- data/gemfiles/rails6.0.gemfile +6 -0
- data/gemfiles/rails6.1.gemfile +6 -0
- data/gemfiles/rails7.0.gemfile +6 -0
- data/lib/zombie_record/restorable.rb +5 -23
- data/lib/zombie_record/version.rb +1 -1
- data/spec/spec_helper.rb +2 -10
- data/zombie_record.gemspec +6 -5
- metadata +21 -35
- data/.travis.yml +0 -20
- data/gemfiles/rails4.1.gemfile +0 -6
- data/gemfiles/rails4.2.gemfile +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91ed49648bae95bb6a4161ab05bad01147c4be33bfef1ed4088a581588194942
|
4
|
+
data.tar.gz: 28e55007206dd1faf809bb7f7bdd325242961207eedb6a0da678783473c9a917
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa39de754f5be4286e20f82a8d6e2bac2b7145f688ba02f6d506ee27e8d02e6e2338bf05511764610267ebd4d46868183358f71a69e1b60517e1e8398825de76
|
7
|
+
data.tar.gz: 2dedb8380345395471c552719164080e6d8a970619a27d5ac7642a0f898536160fa5b5883c88ebdf222cf0dfd9b21affe396919344b4f5820512e920e21509be
|
@@ -0,0 +1,58 @@
|
|
1
|
+
name: CI
|
2
|
+
|
3
|
+
on: push
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
specs:
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
|
9
|
+
strategy:
|
10
|
+
matrix:
|
11
|
+
ruby-version:
|
12
|
+
- '2.6'
|
13
|
+
- '2.7'
|
14
|
+
- '3.0'
|
15
|
+
- '3.1'
|
16
|
+
gemfile:
|
17
|
+
- rails5.0
|
18
|
+
- rails5.1
|
19
|
+
- rails5.2
|
20
|
+
- rails6.0
|
21
|
+
- rails6.1
|
22
|
+
- rails7.0
|
23
|
+
exclude:
|
24
|
+
- {ruby-version: '2.6', gemfile: rails7.0}
|
25
|
+
- {ruby-version: '3.0', gemfile: rails5.0}
|
26
|
+
- {ruby-version: '3.0', gemfile: rails5.1}
|
27
|
+
- {ruby-version: '3.0', gemfile: rails5.2}
|
28
|
+
- {ruby-version: '3.0', gemfile: rails6.0}
|
29
|
+
- {ruby-version: '3.1', gemfile: rails5.0}
|
30
|
+
- {ruby-version: '3.1', gemfile: rails5.1}
|
31
|
+
- {ruby-version: '3.1', gemfile: rails5.2}
|
32
|
+
- {ruby-version: '3.1', gemfile: rails6.0}
|
33
|
+
env:
|
34
|
+
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
|
35
|
+
steps:
|
36
|
+
- uses: zendesk/checkout@v2
|
37
|
+
- name: Set up Ruby
|
38
|
+
uses: zendesk/setup-ruby@v1
|
39
|
+
with:
|
40
|
+
ruby-version: ${{ matrix.ruby-version }}
|
41
|
+
bundler-cache: true
|
42
|
+
- name: RSpec
|
43
|
+
run: bundle exec rspec
|
44
|
+
|
45
|
+
specs_successful:
|
46
|
+
name: Specs passing?
|
47
|
+
needs: specs
|
48
|
+
if: always()
|
49
|
+
runs-on: ubuntu-latest
|
50
|
+
steps:
|
51
|
+
- run: |
|
52
|
+
if ${{ needs.specs.result == 'success' }}
|
53
|
+
then
|
54
|
+
echo "All specs pass"
|
55
|
+
else
|
56
|
+
echo "Some specs failed"
|
57
|
+
false
|
58
|
+
fi
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,18 @@
|
|
1
1
|
###### Unreleased
|
2
2
|
|
3
|
+
###### v1.5.0
|
4
|
+
|
5
|
+
* Add support for Rails 7.0
|
6
|
+
* Add support for Ruby 2.7, 3.0, & 3.1
|
7
|
+
* Drop support for Ruby 2.4 & 2.5
|
8
|
+
* Drop support for Rails 4.2
|
9
|
+
|
10
|
+
###### v1.4.3
|
11
|
+
|
12
|
+
* Drop support for Ruby 2.2 and 2.3.
|
13
|
+
* Drop support for Rails 4.1.
|
14
|
+
* Test against Rails 6.0 and 6.1.
|
15
|
+
|
3
16
|
###### v1.4.2
|
4
17
|
|
5
18
|
* Test against Rails 5.2 final.
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Allows restoring your Active Records from the dead!
|
4
4
|
|
5
|
-
[![Build Status](https://
|
5
|
+
[![Build Status](https://github.com/zendesk/zombie_record/workflows/CI/badge.svg)](https://github.com/zendesk/zombie_record/actions?query=workflow%3ACI)
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
data/Rakefile
CHANGED
data/gemfiles/rails5.0.gemfile
CHANGED
data/gemfiles/rails5.1.gemfile
CHANGED
data/gemfiles/rails5.2.gemfile
CHANGED
@@ -96,12 +96,6 @@ module ZombieRecord
|
|
96
96
|
delegate_to_record(name) { @record.public_send(name, *args, &block) }
|
97
97
|
end
|
98
98
|
|
99
|
-
if ::RUBY_VERSION.start_with?('2.3.')
|
100
|
-
def respond_to_missing?(method, include_all = false)
|
101
|
-
@record.respond_to?(method, include_all)
|
102
|
-
end
|
103
|
-
end
|
104
|
-
|
105
99
|
# We want *all* methods to be delegated.
|
106
100
|
BasicObject.instance_methods.each do |name|
|
107
101
|
define_method(name) do |*args, &block|
|
@@ -154,14 +148,8 @@ module ZombieRecord
|
|
154
148
|
end
|
155
149
|
|
156
150
|
module WithDeletedAssociationsWrapper
|
157
|
-
|
158
|
-
|
159
|
-
super.map(&:with_deleted_associations)
|
160
|
-
end
|
161
|
-
else
|
162
|
-
def records
|
163
|
-
super.map(&:with_deleted_associations)
|
164
|
-
end
|
151
|
+
def records
|
152
|
+
super.map(&:with_deleted_associations)
|
165
153
|
end
|
166
154
|
end
|
167
155
|
|
@@ -178,15 +166,9 @@ module ZombieRecord
|
|
178
166
|
#
|
179
167
|
# Returns an ActiveRecord::Relation.
|
180
168
|
def with_deleted
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
extending(WithDeletedAssociationsWrapper)
|
185
|
-
else
|
186
|
-
all.
|
187
|
-
unscope(where: :deleted_at).
|
188
|
-
extending(WithDeletedAssociationsWrapper)
|
189
|
-
end
|
169
|
+
all.
|
170
|
+
unscope(where: :deleted_at).
|
171
|
+
extending(WithDeletedAssociationsWrapper)
|
190
172
|
end
|
191
173
|
end
|
192
174
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -70,19 +70,11 @@ RSpec.configure do |config|
|
|
70
70
|
end
|
71
71
|
|
72
72
|
config.before :suite do
|
73
|
-
mysql = URI(ENV['MYSQL_URL'] || 'mysql://root@127.0.0.1:3306')
|
74
|
-
|
75
73
|
ActiveRecord::Base.establish_connection(
|
76
|
-
adapter: "
|
77
|
-
|
78
|
-
host: mysql.host,
|
79
|
-
port: mysql.port,
|
80
|
-
password: mysql.password
|
74
|
+
adapter: "sqlite3",
|
75
|
+
database: ":memory:"
|
81
76
|
)
|
82
77
|
|
83
|
-
ActiveRecord::Base.connection.create_database("zombie_record")
|
84
|
-
ActiveRecord::Base.connection.execute("use zombie_record;")
|
85
|
-
|
86
78
|
ActiveRecord::Schema.define do
|
87
79
|
self.verbose = false
|
88
80
|
|
data/zombie_record.gemspec
CHANGED
@@ -15,14 +15,15 @@ Gem::Specification.new do |spec|
|
|
15
15
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
16
16
|
spec.require_paths = ["lib"]
|
17
17
|
|
18
|
-
spec.
|
19
|
-
spec.add_dependency "mysql2"
|
18
|
+
spec.required_ruby_version = ">= 2.6"
|
20
19
|
|
21
|
-
spec.
|
20
|
+
spec.add_dependency "activerecord", ">= 5.0", "< 7.1"
|
21
|
+
|
22
|
+
spec.add_development_dependency "bundler"
|
22
23
|
spec.add_development_dependency "byebug"
|
23
24
|
spec.add_development_dependency "rake"
|
24
25
|
spec.add_development_dependency "bump"
|
25
|
-
spec.add_development_dependency "rspec", "~> 3.5
|
26
|
+
spec.add_development_dependency "rspec", "~> 3.5"
|
27
|
+
spec.add_development_dependency "sqlite3"
|
26
28
|
spec.add_development_dependency "timecop"
|
27
|
-
spec.add_development_dependency "wwtd"
|
28
29
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zombie_record
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Schierbeck
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -16,48 +16,34 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '5.0'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
22
|
+
version: '7.1'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '
|
29
|
+
version: '5.0'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
32
|
+
version: '7.1'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
|
-
name:
|
34
|
+
name: bundler
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
37
|
- - ">="
|
38
38
|
- !ruby/object:Gem::Version
|
39
39
|
version: '0'
|
40
|
-
type: :
|
40
|
+
type: :development
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
44
|
- - ">="
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: '0'
|
47
|
-
- !ruby/object:Gem::Dependency
|
48
|
-
name: bundler
|
49
|
-
requirement: !ruby/object:Gem::Requirement
|
50
|
-
requirements:
|
51
|
-
- - "~>"
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: '1.3'
|
54
|
-
type: :development
|
55
|
-
prerelease: false
|
56
|
-
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
requirements:
|
58
|
-
- - "~>"
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
version: '1.3'
|
61
47
|
- !ruby/object:Gem::Dependency
|
62
48
|
name: byebug
|
63
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -106,16 +92,16 @@ dependencies:
|
|
106
92
|
requirements:
|
107
93
|
- - "~>"
|
108
94
|
- !ruby/object:Gem::Version
|
109
|
-
version: 3.5
|
95
|
+
version: '3.5'
|
110
96
|
type: :development
|
111
97
|
prerelease: false
|
112
98
|
version_requirements: !ruby/object:Gem::Requirement
|
113
99
|
requirements:
|
114
100
|
- - "~>"
|
115
101
|
- !ruby/object:Gem::Version
|
116
|
-
version: 3.5
|
102
|
+
version: '3.5'
|
117
103
|
- !ruby/object:Gem::Dependency
|
118
|
-
name:
|
104
|
+
name: sqlite3
|
119
105
|
requirement: !ruby/object:Gem::Requirement
|
120
106
|
requirements:
|
121
107
|
- - ">="
|
@@ -129,7 +115,7 @@ dependencies:
|
|
129
115
|
- !ruby/object:Gem::Version
|
130
116
|
version: '0'
|
131
117
|
- !ruby/object:Gem::Dependency
|
132
|
-
name:
|
118
|
+
name: timecop
|
133
119
|
requirement: !ruby/object:Gem::Requirement
|
134
120
|
requirements:
|
135
121
|
- - ">="
|
@@ -149,19 +135,20 @@ executables: []
|
|
149
135
|
extensions: []
|
150
136
|
extra_rdoc_files: []
|
151
137
|
files:
|
138
|
+
- ".github/workflows/ci.yml"
|
152
139
|
- ".gitignore"
|
153
140
|
- ".rspec"
|
154
|
-
- ".travis.yml"
|
155
141
|
- CHANGELOG.md
|
156
142
|
- Gemfile
|
157
143
|
- LICENSE.txt
|
158
144
|
- README.md
|
159
145
|
- Rakefile
|
160
|
-
- gemfiles/rails4.1.gemfile
|
161
|
-
- gemfiles/rails4.2.gemfile
|
162
146
|
- gemfiles/rails5.0.gemfile
|
163
147
|
- gemfiles/rails5.1.gemfile
|
164
148
|
- gemfiles/rails5.2.gemfile
|
149
|
+
- gemfiles/rails6.0.gemfile
|
150
|
+
- gemfiles/rails6.1.gemfile
|
151
|
+
- gemfiles/rails7.0.gemfile
|
165
152
|
- lib/zombie_record.rb
|
166
153
|
- lib/zombie_record/restorable.rb
|
167
154
|
- lib/zombie_record/version.rb
|
@@ -172,7 +159,7 @@ homepage: https://github.com/zendesk/zombie_record
|
|
172
159
|
licenses:
|
173
160
|
- MIT
|
174
161
|
metadata: {}
|
175
|
-
post_install_message:
|
162
|
+
post_install_message:
|
176
163
|
rdoc_options: []
|
177
164
|
require_paths:
|
178
165
|
- lib
|
@@ -180,16 +167,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
180
167
|
requirements:
|
181
168
|
- - ">="
|
182
169
|
- !ruby/object:Gem::Version
|
183
|
-
version: '
|
170
|
+
version: '2.6'
|
184
171
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
185
172
|
requirements:
|
186
173
|
- - ">="
|
187
174
|
- !ruby/object:Gem::Version
|
188
175
|
version: '0'
|
189
176
|
requirements: []
|
190
|
-
|
191
|
-
|
192
|
-
signing_key:
|
177
|
+
rubygems_version: 3.1.6
|
178
|
+
signing_key:
|
193
179
|
specification_version: 4
|
194
180
|
summary: Allows restoring your Active Records from the dead!
|
195
181
|
test_files:
|
data/.travis.yml
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
rvm:
|
3
|
-
- 2.2
|
4
|
-
- 2.3
|
5
|
-
- 2.4
|
6
|
-
- 2.5
|
7
|
-
gemfile:
|
8
|
-
- gemfiles/rails4.1.gemfile
|
9
|
-
- gemfiles/rails4.2.gemfile
|
10
|
-
- gemfiles/rails5.0.gemfile
|
11
|
-
- gemfiles/rails5.1.gemfile
|
12
|
-
- gemfiles/rails5.2.gemfile
|
13
|
-
bundler_args: ""
|
14
|
-
script: "bundle exec rake spec"
|
15
|
-
matrix:
|
16
|
-
exclude:
|
17
|
-
- rvm: 2.4
|
18
|
-
gemfile: gemfiles/rails4.1.gemfile
|
19
|
-
- rvm: 2.5
|
20
|
-
gemfile: gemfiles/rails4.1.gemfile
|
data/gemfiles/rails4.1.gemfile
DELETED