database_cleaner 1.8.2 → 1.8.3

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: ce938b49b786dde644fba6552ca9ed80d3c4b883b9f59d8d2c96922c3391b4ec
4
- data.tar.gz: f6ffaab1c716a8ee0844246fbcfaebddb64dbd01a25ae1f057399121a4c75895
3
+ metadata.gz: 2014e2b6a88fc052138027fe636b0832e1e82ed0da858fdfc6b4c57e25b4c640
4
+ data.tar.gz: 27a439c3e5fe70c98c49bd79be9c534ec35695a6f36ab5eba6fd272fc0a30e39
5
5
  SHA512:
6
- metadata.gz: 4dec342492ed7126c8f3f99ae0cac0ac60aba4559646ee7f680b5b558bc900b2242ad89729abf273389a783651233abf7c4e19a9ff4b58a1c28b3e6c26cfd166
7
- data.tar.gz: 1fa1ff665ab2c0e7b87bbf47fda9b0e9ea0787ee5734189e7fd8834745fb14ace49f15373c6e966c65395ddd699465623aa1e155eb42398e7830b08468f9bfb5
6
+ metadata.gz: 68441f1d78a2dec098872b0d0cf37823c853ff6b2377229b5e81396ff31b4927f48c567b4ab163dd583d6b455050c312d555c87b0ff870c9e5494c9ac06146cb
7
+ data.tar.gz: 0ddef43b158cc15263307bbf5bae0c92363fa6e882b5f7cc1ccb5cf7831d092c4da8549cd21c8bfca0be955299105b4023e333cc68c5c3180206ff3b79e6aea0
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- database_cleaner (1.8.2)
4
+ database_cleaner (1.8.3)
5
5
 
6
6
  PATH
7
7
  remote: adapters
@@ -32,7 +32,7 @@ PATH
32
32
  database_cleaner-neo4j (1.8.0)
33
33
  database_cleaner (~> 1.8.0)
34
34
  neo4j-core
35
- database_cleaner-ohm (1.8.0)
35
+ database_cleaner-ohm (1.8.1)
36
36
  database_cleaner (~> 1.8.0)
37
37
  database_cleaner-redis (~> 1.8.0)
38
38
  ohm
@@ -1,5 +1,10 @@
1
1
  == Development (master)
2
2
 
3
+ == 1.8.3 2020-02-18
4
+
5
+ === Bug Fixes
6
+ * Fix performance issue of DatabaseCleaner::Base#orm_module: https://github.com/DatabaseCleaner/database_cleaner/pull/625
7
+
3
8
  == 1.8.2 2020-02-01
4
9
 
5
10
  === Bug Fixes
@@ -1,5 +1,5 @@
1
1
  module DatabaseCleaner
2
2
  module Ohm
3
- VERSION = "1.8.0"
3
+ VERSION = "1.8.1"
4
4
  end
5
5
  end
@@ -116,15 +116,23 @@ module DatabaseCleaner
116
116
 
117
117
  def orm_module
118
118
  return unless [:active_record, :data_mapper, :mongo, :mongoid, :mongo_mapper, :moped, :couch_potato, :sequel, :ohm, :redis, :neo4j].include?(orm)
119
+ load_adapter(orm) if !adapter_loaded?(orm)
120
+ orm_module_name = ORMAutodetector::ORMS[orm]
121
+ DatabaseCleaner.const_get(orm_module_name, false)
122
+ end
123
+
124
+ def adapter_loaded? orm
125
+ $LOADED_FEATURES.grep(%r{/lib/database_cleaner/#{orm}\.rb$}).any?
126
+ end
127
+
128
+ def load_adapter orm
119
129
  $LOAD_PATH.unshift File.expand_path("#{File.dirname(__FILE__)}/../../adapters/database_cleaner-#{orm}/lib")
120
130
  require "database_cleaner/#{orm}"
121
- orm_module_name = ORMAutodetector::ORMS[orm]
122
- DatabaseCleaner.const_get(orm_module_name)
123
131
  end
124
132
 
125
133
  def orm_strategy(strategy)
126
134
  strategy_module_name = strategy.to_s.capitalize
127
- orm_module.const_get(strategy_module_name)
135
+ orm_module.const_get(strategy_module_name, false)
128
136
  rescue NameError
129
137
  if orm != :active_record
130
138
  DatabaseCleaner.deprecate <<-TEXT
@@ -1,3 +1,3 @@
1
1
  module DatabaseCleaner
2
- VERSION = "1.8.2"
2
+ VERSION = "1.8.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: database_cleaner
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.2
4
+ version: 1.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Mabey
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-02-02 00:00:00.000000000 Z
12
+ date: 2020-02-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake