database_cleaner-active_record 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +8 -0
- data/README.md +2 -2
- data/lib/database_cleaner/active_record/truncation.rb +2 -2
- data/lib/database_cleaner/active_record/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: 0f4e22827466f77ef287a8cfa7cf75078940f69f4e3b222676d7cb30d74edb74
|
4
|
+
data.tar.gz: 942936724f8ef0e4a0107044aef35b203e6e8d23c1a6d241d452342eb1d8ae17
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8116e18c0f97636ab92457c6025ef7978547aba2553c747e8120b7ac528fe583f6f1cc76cbc78385c2a26fa6a6a348d37c95c5440186404259a4d50b39200b9d
|
7
|
+
data.tar.gz: e847363c1be911931358c9b1cb3f09717e302b2e89aa609ce366baa1ec6664fbf3935b4c52b6785cfac25f36794992a118edc9846774a485e26fa7aeaa27896e
|
data/.travis.yml
CHANGED
@@ -6,11 +6,19 @@ rvm:
|
|
6
6
|
- 2.5
|
7
7
|
- 2.6
|
8
8
|
- 2.7
|
9
|
+
- 3.0
|
9
10
|
gemfile:
|
10
11
|
- gemfiles/rails_5.1.gemfile
|
11
12
|
- gemfiles/rails_5.2.gemfile
|
12
13
|
- gemfiles/rails_6.0.gemfile
|
13
14
|
- gemfiles/rails_6.1.gemfile
|
15
|
+
jobs:
|
16
|
+
exclude: # Unsupported combos: https://www.fastruby.io/blog/ruby/rails/versions/compatibility-table.html
|
17
|
+
- rvm: 3.0
|
18
|
+
gemfiles/rails_5.1.gemfile
|
19
|
+
- rvm: 3.0
|
20
|
+
gemfiles/rails_5.2.gemfile
|
21
|
+
|
14
22
|
before_install:
|
15
23
|
- bin/setup
|
16
24
|
cache:
|
data/README.md
CHANGED
@@ -51,10 +51,10 @@ The truncation and deletion strategies may accept the following options:
|
|
51
51
|
|
52
52
|
```ruby
|
53
53
|
# Only truncate the "users" table.
|
54
|
-
DatabaseCleaner[:active_record].strategy = :truncation,
|
54
|
+
DatabaseCleaner[:active_record].strategy = :truncation, only: ["users"]
|
55
55
|
|
56
56
|
# Delete all tables except the "users" table.
|
57
|
-
DatabaseCleaner[:active_record].strategy = :deletion,
|
57
|
+
DatabaseCleaner[:active_record].strategy = :deletion, except: ["users"]
|
58
58
|
```
|
59
59
|
|
60
60
|
* `: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`. (Also, see the section on [What strategy is fastest?](#what-strategy-is-fastest))
|
@@ -67,7 +67,7 @@ module DatabaseCleaner
|
|
67
67
|
when "SQLite"
|
68
68
|
extend AbstractMysqlAdapter
|
69
69
|
extend SQLiteAdapter
|
70
|
-
when "PostgreSQL"
|
70
|
+
when "PostgreSQL", "PostGIS"
|
71
71
|
extend AbstractMysqlAdapter
|
72
72
|
extend PostgreSQLAdapter
|
73
73
|
end
|
@@ -189,7 +189,7 @@ module DatabaseCleaner
|
|
189
189
|
|
190
190
|
def truncate_tables(table_names)
|
191
191
|
return if table_names.nil? || table_names.empty?
|
192
|
-
execute("TRUNCATE TABLE #{table_names.map{|name| quote_table_name(name)}.join(', ')} RESTART IDENTITY
|
192
|
+
execute("TRUNCATE TABLE #{table_names.map{|name| quote_table_name(name)}.join(', ')} RESTART IDENTITY RESTRICT;")
|
193
193
|
end
|
194
194
|
|
195
195
|
def pre_count_truncate_tables(tables)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: database_cleaner-active_record
|
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: 2021-
|
12
|
+
date: 2021-05-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: database_cleaner-core
|
@@ -188,7 +188,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
188
188
|
- !ruby/object:Gem::Version
|
189
189
|
version: '0'
|
190
190
|
requirements: []
|
191
|
-
rubygems_version: 3.
|
191
|
+
rubygems_version: 3.1.4
|
192
192
|
signing_key:
|
193
193
|
specification_version: 4
|
194
194
|
summary: Strategies for cleaning databases using ActiveRecord. Can be used to ensure
|