activerecord-jdbc-adapter 1.0.0-java → 1.0.1-java

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
@@ -1,3 +1,8 @@
1
+ == 1.0.1
2
+
3
+ - Fix db:test:purge issue affecting all adapters in 1.0.0 due to
4
+ incorrect fix to JRUBY-5081 in 8b4b9c5
5
+
1
6
  == 1.0.0
2
7
 
3
8
  - Thanks to David Kellum, Dmitry Denisov, Dwayne Litzenberger, Gregor
Binary file
@@ -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
- ActiveRecord::Base.connection.drop_database(find_database_name(config))
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
- ActiveRecord::Base.connection.recreate_database(find_database_name(abcs['test']))
123
+ db = find_database_name(abcs['test'])
124
+ ActiveRecord::Base.connection.recreate_database(db)
122
125
  end
123
126
  end
124
127
  end
@@ -1,6 +1,6 @@
1
1
  module ArJdbc
2
2
  module Version
3
- VERSION = "1.0.0"
3
+ VERSION = "1.0.1"
4
4
  end
5
5
  end
6
6
  # Compatibility with older versions of ar-jdbc for other extensions out there
@@ -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
@@ -18,6 +18,11 @@ class MysqlDbCreateTest < Test::Unit::TestCase
18
18
  assert mysql.read =~ /#{@db_name}/m
19
19
  end
20
20
  end
21
+
22
+ def test_rake_db_test_purge
23
+ Rake::Task["db:create"].invoke
24
+ Rake::Task["db:test:purge"].invoke
25
+ end
21
26
  else
22
27
  def test_skipped
23
28
  end
@@ -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
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 0
8
- - 0
9
- version: 1.0.0
8
+ - 1
9
+ version: 1.0.1
10
10
  platform: java
11
11
  authors:
12
12
  - Nick Sieger, Ola Bini and JRuby contributors