db-purger 0.2.9 → 0.2.10

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: 1b02f775fa7aab4ec9f66c284022d47029934a06cb88fa6f557a5622e0fb0d7d
4
- data.tar.gz: 25499a911e8fafc29b6e42ecb2126b2f18fa1ab1efbf487ca6d2257cea3b193b
3
+ metadata.gz: 2fc223dbeccc5fbcaa19d25e1c2a63741e15ce013d07a99d33c6fe4d2b95f220
4
+ data.tar.gz: 834d39435ebd2c96dafe5158a38e48930bc75bcf64b785cbf60b13184cdca69d
5
5
  SHA512:
6
- metadata.gz: ef7820e5441d402a2632e4b786cbcaac2bbe14f3f6607f72640b877717e806df976bce8348a13cfea2fcdf88fa995118aa61288f71b810afd9bee1ad62b097b0
7
- data.tar.gz: 6aae4dbd47fccd561cecf80c0e5d7f54d195d1591cdc7ff28f993f9efa50e150161e65e667e8435759618d67303c21d198d8411191d4a296d5a9f334aff0e3dd
6
+ metadata.gz: 2c6a503a148ed02a2e1d852d28c930b7801fba387352ff2c825dab45cef2706e8715461842f8ea4e55c45b7a0ba56e72fe96ab9685e8a928f3a8920aa9b3644c
7
+ data.tar.gz: 6518a0adbf0cd1594c3f2ae9c0eed233fb0648a55c5981a8319f135c7f1f00455fbbc2b6d5b21f29f82855c9b3ecf37e4c145b13c6bd30c658016f20ffa05c06
@@ -32,6 +32,13 @@ module DBPurger
32
32
  all_tables
33
33
  end
34
34
 
35
+ def foreign_tables
36
+ (@base_table ? [@base_table] : []) +
37
+ @parent_tables +
38
+ @child_tables +
39
+ @search_tables
40
+ end
41
+
35
42
  def table_names
36
43
  tables.map(&:name)
37
44
  end
@@ -73,7 +73,7 @@ module DBPurger
73
73
  else
74
74
  scope.to_sql.sub(/SELECT .*?FROM/, 'DELETE FROM')
75
75
  end
76
- ::DBPurger.config.explain_file.puts(sql)
76
+ ::DBPurger.config.explain_file.puts(sql + ';')
77
77
  scope.count
78
78
  end
79
79
 
@@ -37,7 +37,7 @@ module DBPurger
37
37
  end
38
38
 
39
39
  def foreign_keys
40
- @nested_plan ? @nested_plan.tables.map(&:foreign_key).compact : []
40
+ @nested_plan ? @nested_plan.foreign_tables.map(&:foreign_key).compact : []
41
41
  end
42
42
 
43
43
  def fields
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: db-purger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.9
4
+ version: 0.2.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Doug Youch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-26 00:00:00.000000000 Z
11
+ date: 2019-07-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dynamic-active-model