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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 603d03ebaf5a1164056c49beee4ec41096f681e5d158c2cc9cc31f58a357fbdb
4
- data.tar.gz: 8847571885cacaf878e96649a4fd694f91b991ff1eb67b76506228e1412ed433
3
+ metadata.gz: 91ed49648bae95bb6a4161ab05bad01147c4be33bfef1ed4088a581588194942
4
+ data.tar.gz: 28e55007206dd1faf809bb7f7bdd325242961207eedb6a0da678783473c9a917
5
5
  SHA512:
6
- metadata.gz: 4fe171d2153615597613d3d8d539533241fcbc000dbb08b65f91fb5002555245089304556d0ade242b89010b2e21a3b195d2427a825b3fee254ef159c5bb2384
7
- data.tar.gz: 955b8357b8d2fbd008e4e2e1653bf6cf6dff00d44688279d269a7e8679e50a471b0824c36ae3cd57c952a6ba848442f4d61abbfd787f839c2601f10a4297997a
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
@@ -3,7 +3,7 @@
3
3
  .bundle
4
4
  .config
5
5
  .yardoc
6
- *[Gg]emfile.lock
6
+ /Gemfile.lock
7
7
  InstalledFiles
8
8
  _yardoc
9
9
  coverage
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://travis-ci.org/zendesk/zombie_record.svg?branch=master)](https://travis-ci.org/zendesk/zombie_record)
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
@@ -1,8 +1,2 @@
1
1
  require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
3
- require "wwtd/tasks"
4
2
  require "bump/tasks"
5
-
6
- RSpec::Core::RakeTask.new(:spec)
7
-
8
- task :default => "wwtd:local"
@@ -3,3 +3,4 @@ source 'https://rubygems.org'
3
3
  gemspec path: "../"
4
4
 
5
5
  gem "activerecord", "~> 5.0.0"
6
+ gem 'sqlite3', '~> 1.3.6'
@@ -3,3 +3,4 @@ source 'https://rubygems.org'
3
3
  gemspec path: "../"
4
4
 
5
5
  gem "activerecord", "~> 5.1.0"
6
+ gem "sqlite3", "~> 1.3", ">= 1.3.6"
@@ -3,3 +3,4 @@ source 'https://rubygems.org'
3
3
  gemspec path: "../"
4
4
 
5
5
  gem "activerecord", "~> 5.2.0"
6
+ gem "sqlite3", "~> 1.3", ">= 1.3.6"
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec path: "../"
4
+
5
+ gem "activerecord", "~> 6.0.0"
6
+ gem "sqlite3", "~> 1.4"
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec path: "../"
4
+
5
+ gem "activerecord", "~> 6.1.0"
6
+ gem "sqlite3", "~> 1.4"
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec path: "../"
4
+
5
+ gem "activerecord", "~> 7.0.0"
6
+ gem "sqlite3", "~> 1.4"
@@ -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
- if ActiveRecord::VERSION::MAJOR < 5
158
- def to_a
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
- if ActiveRecord::VERSION::MAJOR == 4 && ActiveRecord::VERSION::MINOR == 0
182
- all.
183
- tap {|relation| relation.default_scoped = false }.
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
@@ -1,3 +1,3 @@
1
1
  module ZombieRecord
2
- VERSION = "1.4.2"
2
+ VERSION = "1.5.0"
3
3
  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: "mysql2",
77
- username: mysql.user,
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
 
@@ -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.add_dependency "activerecord", ">= 4.1", "< 6.0"
19
- spec.add_dependency "mysql2"
18
+ spec.required_ruby_version = ">= 2.6"
20
19
 
21
- spec.add_development_dependency "bundler", "~> 1.3"
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.0"
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.2
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: 2018-04-11 00:00:00.000000000 Z
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: '4.1'
19
+ version: '5.0'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '6.0'
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: '4.1'
29
+ version: '5.0'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '6.0'
32
+ version: '7.1'
33
33
  - !ruby/object:Gem::Dependency
34
- name: mysql2
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: :runtime
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.0
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.0
102
+ version: '3.5'
117
103
  - !ruby/object:Gem::Dependency
118
- name: timecop
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: wwtd
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: '0'
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
- rubyforge_project:
191
- rubygems_version: 2.7.6
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
@@ -1,6 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec path: "../"
4
-
5
- gem "activerecord", "~> 4.1.8"
6
- gem "mysql2", "~> 0.3.0"
@@ -1,6 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec path: "../"
4
-
5
- gem "activerecord", "~> 4.2.0"
6
- gem "mysql2", "~> 0.4.0"