zombie_record 1.5.0 → 1.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/publish.yml +12 -0
- data/CHANGELOG.md +4 -0
- data/lib/zombie_record/restorable.rb +2 -0
- data/lib/zombie_record/version.rb +1 -1
- data/spec/restorable_spec.rb +9 -0
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 77c2b09a1e5552f5f0c1a1a2b0beba87267c3342057439b606f37422c3ae65ba
|
4
|
+
data.tar.gz: 3904f6d838bccee4355a73eb97b2eb17e56d6469f82ffc83d1f31fb5e8d9b4df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc8cba4a7b46ca10c9933ac19d9e5c5eeec7309eb5894f76b6fc76a3b1c9f7ee109c4f49a30ecd60297b74ff219efc52867e8d81c7f4601e7ebcbd5da2d18917
|
7
|
+
data.tar.gz: e43f02c6dd634541f4bf6cfffbe7df5c6adfe09b9c9ae094510cf73595e087f6d129add06b707a539cdc3a8673ffd3d74623f6500e5de7c5d0929ae6adc14f70
|
@@ -0,0 +1,12 @@
|
|
1
|
+
name: Publish Gem
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
tags: v*
|
6
|
+
|
7
|
+
jobs:
|
8
|
+
call-workflow:
|
9
|
+
uses: zendesk/gw/.github/workflows/ruby-gem-publication.yml@main
|
10
|
+
secrets:
|
11
|
+
RUBY_GEMS_API_KEY: ${{ secrets.RUBY_GEMS_API_KEY }}
|
12
|
+
RUBY_GEMS_TOTP_DEVICE: ${{ secrets.RUBY_GEMS_TOTP_DEVICE }}
|
data/CHANGELOG.md
CHANGED
@@ -96,6 +96,8 @@ module ZombieRecord
|
|
96
96
|
delegate_to_record(name) { @record.public_send(name, *args, &block) }
|
97
97
|
end
|
98
98
|
|
99
|
+
ruby2_keywords :method_missing if respond_to?(:ruby2_keywords, true)
|
100
|
+
|
99
101
|
# We want *all* methods to be delegated.
|
100
102
|
BasicObject.instance_methods.each do |name|
|
101
103
|
define_method(name) do |*args, &block|
|
data/spec/restorable_spec.rb
CHANGED
@@ -62,6 +62,15 @@ RSpec.describe ZombieRecord::Restorable do
|
|
62
62
|
# #flatten will implicitly call #to_ary
|
63
63
|
expect([[[book]]].flatten).to eq([book])
|
64
64
|
end
|
65
|
+
|
66
|
+
it "doesn't re-save duplicated record" do
|
67
|
+
book = Book.create!(title: "The Odyssey")
|
68
|
+
book.destroy
|
69
|
+
book_dup = Book.with_deleted.first.save(validate: true)
|
70
|
+
|
71
|
+
expect(Book.count).to eq(0)
|
72
|
+
expect(Book.with_deleted.size).to eq(1)
|
73
|
+
end
|
65
74
|
end
|
66
75
|
|
67
76
|
describe ".deleted" do
|
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.5.
|
4
|
+
version: 1.5.1
|
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: 2023-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -136,6 +136,7 @@ extensions: []
|
|
136
136
|
extra_rdoc_files: []
|
137
137
|
files:
|
138
138
|
- ".github/workflows/ci.yml"
|
139
|
+
- ".github/workflows/publish.yml"
|
139
140
|
- ".gitignore"
|
140
141
|
- ".rspec"
|
141
142
|
- CHANGELOG.md
|
@@ -159,7 +160,7 @@ homepage: https://github.com/zendesk/zombie_record
|
|
159
160
|
licenses:
|
160
161
|
- MIT
|
161
162
|
metadata: {}
|
162
|
-
post_install_message:
|
163
|
+
post_install_message:
|
163
164
|
rdoc_options: []
|
164
165
|
require_paths:
|
165
166
|
- lib
|
@@ -174,8 +175,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
174
175
|
- !ruby/object:Gem::Version
|
175
176
|
version: '0'
|
176
177
|
requirements: []
|
177
|
-
rubygems_version: 3.1
|
178
|
-
signing_key:
|
178
|
+
rubygems_version: 3.0.3.1
|
179
|
+
signing_key:
|
179
180
|
specification_version: 4
|
180
181
|
summary: Allows restoring your Active Records from the dead!
|
181
182
|
test_files:
|