activerecord-jdbc-adapter 1.0.0-java → 1.0.1-java
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +5 -0
- data/lib/arjdbc/jdbc/adapter_java.jar +0 -0
- data/lib/arjdbc/jdbc/jdbc.rake +5 -2
- data/lib/arjdbc/version.rb +1 -1
- data/test/abstract_db_create.rb +2 -0
- data/test/mysql_db_create_test.rb +5 -0
- data/test/postgres_db_create_test.rb +5 -0
- metadata +2 -2
data/History.txt
CHANGED
Binary file
|
data/lib/arjdbc/jdbc/jdbc.rake
CHANGED
@@ -28,7 +28,8 @@ namespace :db do
|
|
28
28
|
redefine_task :drop => :environment do
|
29
29
|
config = ActiveRecord::Base.configurations[rails_env]
|
30
30
|
begin
|
31
|
-
|
31
|
+
db = find_database_name(config)
|
32
|
+
ActiveRecord::Base.connection.drop_database(db)
|
32
33
|
rescue
|
33
34
|
drop_database(config.merge('adapter' => config['adapter'].sub(/^jdbc/, '')))
|
34
35
|
end
|
@@ -49,6 +50,7 @@ namespace :db do
|
|
49
50
|
end
|
50
51
|
|
51
52
|
def find_database_name(config)
|
53
|
+
db = config['database']
|
52
54
|
if config['adapter'] =~ /postgresql/i
|
53
55
|
config = config.dup
|
54
56
|
if config['url']
|
@@ -118,7 +120,8 @@ namespace :db do
|
|
118
120
|
|
119
121
|
redefine_task :purge => :environment do
|
120
122
|
abcs = ActiveRecord::Base.configurations
|
121
|
-
|
123
|
+
db = find_database_name(abcs['test'])
|
124
|
+
ActiveRecord::Base.connection.recreate_database(db)
|
122
125
|
end
|
123
126
|
end
|
124
127
|
end
|
data/lib/arjdbc/version.rb
CHANGED
data/test/abstract_db_create.rb
CHANGED
@@ -57,6 +57,8 @@ module AbstractDbCreate
|
|
57
57
|
the_db_name = @db_name
|
58
58
|
the_db_config = db_config
|
59
59
|
@configs = { "unittest" => the_db_config.merge({:database => the_db_name}).stringify_keys! }
|
60
|
+
@configs["test"] = @configs["unittest"].dup
|
61
|
+
@configs
|
60
62
|
end
|
61
63
|
|
62
64
|
def setup_rails2
|
@@ -14,6 +14,11 @@ class PostgresDbCreateTest < Test::Unit::TestCase
|
|
14
14
|
output = `psql -c '\\l'`
|
15
15
|
assert output =~ /#{@db_name}/m
|
16
16
|
end
|
17
|
+
|
18
|
+
def test_rake_db_test_purge
|
19
|
+
Rake::Task["db:create"].invoke
|
20
|
+
Rake::Task["db:test:purge"].invoke
|
21
|
+
end
|
17
22
|
else
|
18
23
|
def test_skipped
|
19
24
|
end
|