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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c43ef731e44e9d819825abd6bf2a0a013a46d5f1
4
- data.tar.gz: 02505f6ad68fbf819d3bfff1da3377f7ed70afc5
3
+ metadata.gz: b376682c2f67881f7a3f6d94cdee69ca9c2d91d4
4
+ data.tar.gz: bbe492eaf822b8964c6921591fdc348d87afcd91
5
5
  SHA512:
6
- metadata.gz: 05c4efb51990bc523e2a441a06eb65bfedd042435fa1a9534bc08739e61be28366f2a8892605730e69de87463695a59d1ceb6a3309f949a756b71bc25033a3fc
7
- data.tar.gz: 73c45aaecf4ac026b1903cca7ae61cdf9fdf9024b0833b81f4aa68bc0a95ed698001fad6f49e5bc36b11c9a8b893f31bad3a7e3f679baa5921fbc2184220d692
6
+ metadata.gz: 58460132f5cbfaa52a83c962511a2092e079cc66c6295ea3a702ca105c136f2bfbdbff66b933b83b1ce5c0268d92b0ba024d514fa814358677c38eb13e109b36
7
+ data.tar.gz: 80ec799e958f0e5eb29edad2e9aaf975120eda596cb27093c8832792ca8e5cafa88b7e478f05129cb43efaf11d22e4a786ec3d3d61593462fe47f844b60c7010
@@ -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.0'
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 (ar_conn = (pool || find_already_connected_model).try :connection)
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: database_rewinder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Akira Matsuda