database_rewinder 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/database_rewinder.gemspec +1 -1
- data/lib/database_rewinder/cleaner.rb +2 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b376682c2f67881f7a3f6d94cdee69ca9c2d91d4
|
4
|
+
data.tar.gz: bbe492eaf822b8964c6921591fdc348d87afcd91
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58460132f5cbfaa52a83c962511a2092e079cc66c6295ea3a702ca105c136f2bfbdbff66b933b83b1ce5c0268d92b0ba024d514fa814358677c38eb13e109b36
|
7
|
+
data.tar.gz: 80ec799e958f0e5eb29edad2e9aaf975120eda596cb27093c8832792ca8e5cafa88b7e478f05129cb43efaf11d22e4a786ec3d3d61593462fe47f844b60c7010
|
data/database_rewinder.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "database_rewinder"
|
7
|
-
spec.version = '0.4.
|
7
|
+
spec.version = '0.4.1'
|
8
8
|
spec.authors = ["Akira Matsuda"]
|
9
9
|
spec.email = ["ronnie@dio.jp"]
|
10
10
|
spec.description = "A minimalist's tiny and ultra-fast database cleaner"
|
@@ -25,7 +25,8 @@ module DatabaseRewinder
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def clean_all
|
28
|
-
if
|
28
|
+
if pool
|
29
|
+
ar_conn = pool.connection
|
29
30
|
delete_all ar_conn, DatabaseRewinder.all_table_names(ar_conn)
|
30
31
|
else
|
31
32
|
require 'database_rewinder/dummy_model'
|
@@ -61,10 +62,6 @@ module DatabaseRewinder
|
|
61
62
|
ensure
|
62
63
|
pool.automatic_reconnect = reconnect
|
63
64
|
end
|
64
|
-
|
65
|
-
def find_already_connected_model
|
66
|
-
ActiveRecord::Base.descendants.detect {|m| m.connection_pool.spec.config[:database] == db}
|
67
|
-
end
|
68
65
|
end
|
69
66
|
end
|
70
67
|
|