database_cleaner 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +5 -0
- data/VERSION.yml +1 -1
- data/lib/database_cleaner/data_mapper/truncation.rb +5 -5
- metadata +2 -2
data/History.txt
CHANGED
data/VERSION.yml
CHANGED
@@ -15,7 +15,7 @@ module DataMapper
|
|
15
15
|
|
16
16
|
# taken from http://github.com/godfat/dm-mapping/tree/master
|
17
17
|
def storage_names(repository = :default)
|
18
|
-
|
18
|
+
select 'SHOW TABLES'
|
19
19
|
end
|
20
20
|
|
21
21
|
def truncate_table(table_name)
|
@@ -24,7 +24,7 @@ module DataMapper
|
|
24
24
|
|
25
25
|
# copied from activerecord
|
26
26
|
def disable_referential_integrity
|
27
|
-
old =
|
27
|
+
old = select("SELECT @@FOREIGN_KEY_CHECKS;")
|
28
28
|
begin
|
29
29
|
execute("SET FOREIGN_KEY_CHECKS = 0;")
|
30
30
|
yield
|
@@ -46,7 +46,7 @@ module DataMapper
|
|
46
46
|
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
47
47
|
SQL
|
48
48
|
# activerecord-2.1.0/lib/active_record/connection_adapters/sqlite_adapter.rb: 181
|
49
|
-
|
49
|
+
select sql
|
50
50
|
end
|
51
51
|
|
52
52
|
def truncate_table(table_name)
|
@@ -76,7 +76,7 @@ module DataMapper
|
|
76
76
|
SELECT table_name FROM "information_schema"."tables"
|
77
77
|
WHERE table_schema = current_schema()
|
78
78
|
SQL
|
79
|
-
|
79
|
+
select(sql)
|
80
80
|
end
|
81
81
|
|
82
82
|
def truncate_table(table_name)
|
@@ -86,7 +86,7 @@ module DataMapper
|
|
86
86
|
# FIXME
|
87
87
|
# copied from activerecord
|
88
88
|
def supports_disable_referential_integrity?
|
89
|
-
version =
|
89
|
+
version = select("SHOW server_version")[0][0].split('.')
|
90
90
|
(version[0].to_i >= 8 && version[1].to_i >= 1) ? true : false
|
91
91
|
rescue
|
92
92
|
return false
|
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: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Mabey
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-01-
|
12
|
+
date: 2010-01-12 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|