database_cleaner 0.2.3 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +9 -2
- data/TODO +0 -0
- data/VERSION.yml +2 -2
- data/lib/database_cleaner/active_record/truncation.rb +1 -1
- data/lib/database_cleaner/data_mapper/truncation.rb +5 -5
- metadata +9 -7
data/History.txt
CHANGED
@@ -1,4 +1,11 @@
|
|
1
|
-
0.
|
1
|
+
0.3.x (In Git)
|
2
|
+
|
3
|
+
== 0.3.0 2009-12-20
|
4
|
+
|
5
|
+
=== New features
|
6
|
+
* DataMapper 0.10.0 Compatible. (Martin Gamsjaeger)
|
7
|
+
=== Bufixes
|
8
|
+
* Postgres tables with FKs now truncate (added TRUNCADE CASCADE). (Vika - yozhyk on github)
|
2
9
|
|
3
10
|
== 0.2.3 2009-05-30
|
4
11
|
|
@@ -24,7 +31,7 @@
|
|
24
31
|
|
25
32
|
== 0.1.3 2009-04-30
|
26
33
|
|
27
|
-
=== New features
|
34
|
+
=== New features
|
28
35
|
* PostgresSQLAdapter for AR to support the truncation strategy. (Alberto Perdomo)
|
29
36
|
=== Bufixes
|
30
37
|
* Added missing quotes around table names in truncation calls. (Michael MacDonald)
|
data/TODO
ADDED
File without changes
|
data/VERSION.yml
CHANGED
@@ -19,7 +19,7 @@ module DataMapper
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def truncate_table(table_name)
|
22
|
-
execute("TRUNCATE TABLE #{
|
22
|
+
execute("TRUNCATE TABLE #{quote_name(table_name)};")
|
23
23
|
end
|
24
24
|
|
25
25
|
# copied from activerecord
|
@@ -50,7 +50,7 @@ module DataMapper
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def truncate_table(table_name)
|
53
|
-
execute("DELETE FROM #{
|
53
|
+
execute("DELETE FROM #{quote_name(table_name)};")
|
54
54
|
end
|
55
55
|
|
56
56
|
# this is a no-op copied from activerecord
|
@@ -80,7 +80,7 @@ module DataMapper
|
|
80
80
|
end
|
81
81
|
|
82
82
|
def truncate_table(table_name)
|
83
|
-
execute("TRUNCATE TABLE #{
|
83
|
+
execute("TRUNCATE TABLE #{quote_name(table_name)};")
|
84
84
|
end
|
85
85
|
|
86
86
|
# FIXME
|
@@ -97,14 +97,14 @@ module DataMapper
|
|
97
97
|
def disable_referential_integrity(repository = :default)
|
98
98
|
if supports_disable_referential_integrity? then
|
99
99
|
execute(storage_names(repository).collect do |name|
|
100
|
-
"ALTER TABLE #{
|
100
|
+
"ALTER TABLE #{quote_name(name)} DISABLE TRIGGER ALL"
|
101
101
|
end.join(";"))
|
102
102
|
end
|
103
103
|
yield
|
104
104
|
ensure
|
105
105
|
if supports_disable_referential_integrity? then
|
106
106
|
execute(storage_names(repository).collect do |name|
|
107
|
-
"ALTER TABLE #{
|
107
|
+
"ALTER TABLE #{quote_name(name)} ENABLE TRIGGER ALL"
|
108
108
|
end.join(";"))
|
109
109
|
end
|
110
110
|
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: 0.
|
4
|
+
version: 0.3.0
|
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: 2009-
|
12
|
+
date: 2009-12-20 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -22,6 +22,7 @@ extensions: []
|
|
22
22
|
extra_rdoc_files:
|
23
23
|
- LICENSE
|
24
24
|
- README.textile
|
25
|
+
- TODO
|
25
26
|
files:
|
26
27
|
- History.txt
|
27
28
|
- README.textile
|
@@ -49,6 +50,7 @@ files:
|
|
49
50
|
- spec/spec.opts
|
50
51
|
- spec/spec_helper.rb
|
51
52
|
- LICENSE
|
53
|
+
- TODO
|
52
54
|
has_rdoc: true
|
53
55
|
homepage: http://github.com/bmabey/database_cleaner
|
54
56
|
licenses: []
|
@@ -73,15 +75,15 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
73
75
|
requirements: []
|
74
76
|
|
75
77
|
rubyforge_project:
|
76
|
-
rubygems_version: 1.3.
|
78
|
+
rubygems_version: 1.3.5
|
77
79
|
signing_key:
|
78
80
|
specification_version: 3
|
79
81
|
summary: Strategies for cleaning databases. Can be used to ensure a clean state for testing.
|
80
82
|
test_files:
|
81
|
-
- spec/spec_helper.rb
|
82
|
-
- spec/database_cleaner/configuration_spec.rb
|
83
83
|
- spec/database_cleaner/active_record/truncation_spec.rb
|
84
|
-
-
|
85
|
-
-
|
84
|
+
- spec/database_cleaner/configuration_spec.rb
|
85
|
+
- spec/spec_helper.rb
|
86
86
|
- examples/features/step_definitions/example_steps.rb
|
87
87
|
- examples/features/support/env.rb
|
88
|
+
- examples/lib/activerecord.rb
|
89
|
+
- examples/lib/datamapper.rb
|