database_cleaner-sequel 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +4 -4
- data/lib/database_cleaner/sequel/truncation.rb +4 -4
- data/lib/database_cleaner/sequel/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d5e1b976965361003dac738c45cd13b41b7ab2ff7c548b9a5a004f6cbc1589b
|
4
|
+
data.tar.gz: 4143a0a5dec83406b5c4fabde365be5b2de27de9f61e5b8d854b58ce48cc2f1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fbc931ec41104f66d5b621be99a3442facbf6f97b3d5f159d169f7bf551074943987e7892c6377e56b789aade7167e2feb07472b7a66f79518ec8dd370272fb1
|
7
|
+
data.tar.gz: a20490aca31f92f62875e73eef268923ec2aa4f77320018ec074ba5ff9678756f9f190c776afb588e11ab42e3a0777ba2a92aa949bc5a9ba68ab13bbdaa0e559
|
data/README.md
CHANGED
@@ -50,10 +50,10 @@ The truncation and deletion strategies may accept the following options:
|
|
50
50
|
|
51
51
|
```ruby
|
52
52
|
# Only truncate the "users" table.
|
53
|
-
DatabaseCleaner[:sequel].strategy = :truncation,
|
53
|
+
DatabaseCleaner[:sequel].strategy = :truncation, only: ["users"]
|
54
54
|
|
55
55
|
# Delete all tables except the "users" table.
|
56
|
-
DatabaseCleaner[:sequel].strategy = :deletion,
|
56
|
+
DatabaseCleaner[:sequel].strategy = :deletion, except: ["users"]
|
57
57
|
```
|
58
58
|
|
59
59
|
* `:pre_count` - When set to `true`, this will check each table for existing rows before truncating or deleting it. This can speed up test suites when many of the tables are never populated. Defaults to `false`.
|
@@ -70,8 +70,8 @@ DatabaseCleaner[:sequel].db = Sequel.connect(uri)
|
|
70
70
|
DatabaseCleaner[:sequel].db = :default
|
71
71
|
|
72
72
|
# Multiple Sequel databases can be specified:
|
73
|
-
DatabaseCleaner[:sequel,
|
74
|
-
DatabaseCleaner[:sequel,
|
73
|
+
DatabaseCleaner[:sequel, db: :default]
|
74
|
+
DatabaseCleaner[:sequel, db: Sequel.connect(uri)]
|
75
75
|
```
|
76
76
|
## COPYRIGHT
|
77
77
|
|
@@ -3,10 +3,10 @@ require 'database_cleaner/sequel/base'
|
|
3
3
|
module DatabaseCleaner
|
4
4
|
module Sequel
|
5
5
|
class Truncation < Base
|
6
|
-
def initialize
|
7
|
-
@only = only
|
8
|
-
@except = except
|
9
|
-
@pre_count = pre_count
|
6
|
+
def initialize(opts)
|
7
|
+
@only = opts[:only] || []
|
8
|
+
@except = opts[:except] || []
|
9
|
+
@pre_count = opts[:pre_count] || false
|
10
10
|
end
|
11
11
|
|
12
12
|
def start
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: database_cleaner-sequel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ernesto Tagwerker
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2022-03-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: database_cleaner-core
|
@@ -169,7 +169,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
169
169
|
- !ruby/object:Gem::Version
|
170
170
|
version: '0'
|
171
171
|
requirements: []
|
172
|
-
rubygems_version: 3.0.3
|
172
|
+
rubygems_version: 3.0.3.1
|
173
173
|
signing_key:
|
174
174
|
specification_version: 4
|
175
175
|
summary: Strategies for cleaning databases using Sequel. Can be used to ensure a clean
|