database_cleaner 0.6.5 → 0.6.6
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
CHANGED
data/VERSION.yml
CHANGED
@@ -60,18 +60,15 @@ module ActiveRecord
|
|
60
60
|
class PostgreSQLAdapter < AbstractAdapter
|
61
61
|
|
62
62
|
def db_version
|
63
|
-
@db_version ||=
|
64
|
-
"SELECT CHARACTER_VALUE
|
65
|
-
FROM INFORMATION_SCHEMA.SQL_IMPLEMENTATION_INFO
|
66
|
-
WHERE IMPLEMENTATION_INFO_NAME = 'DBMS VERSION' ").join.to_s
|
63
|
+
@db_version ||= postgresql_version
|
67
64
|
end
|
68
65
|
|
69
66
|
def cascade
|
70
|
-
@cascade ||= db_version >=
|
67
|
+
@cascade ||= db_version >= 80200 ? 'CASCADE' : ''
|
71
68
|
end
|
72
69
|
|
73
70
|
def restart_identity
|
74
|
-
@restart_identity ||= db_version >=
|
71
|
+
@restart_identity ||= db_version >= 80400 ? 'RESTART IDENTITY' : ''
|
75
72
|
end
|
76
73
|
|
77
74
|
def truncate_table(table_name)
|
@@ -62,6 +62,16 @@ module ::DatabaseCleaner
|
|
62
62
|
its(:only) { should == nil }
|
63
63
|
its(:except) { should == ["migration_storage_name"] }
|
64
64
|
end
|
65
|
+
|
66
|
+
context "" do
|
67
|
+
EXCEPT_TABLES = ["something"]
|
68
|
+
subject { MigrationExample.new( { :except => EXCEPT_TABLES } ) }
|
69
|
+
|
70
|
+
it "should not modify the array of excepted tables" do
|
71
|
+
subject.except.should include("migration_storage_name")
|
72
|
+
EXCEPT_TABLES.should_not include("migration_storage_name")
|
73
|
+
end
|
74
|
+
end
|
65
75
|
end
|
66
76
|
end
|
67
77
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: database_cleaner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 11
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 6
|
9
|
-
-
|
10
|
-
version: 0.6.
|
9
|
+
- 6
|
10
|
+
version: 0.6.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ben Mabey
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-03-
|
18
|
+
date: 2011-03-16 00:00:00 -06:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|