activerecord-jdbcas400-adapter 1.3.9 → 1.3.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/Rakefile +8 -0
- data/lib/arjdbc/as400/adapter.rb +12 -6
- data/test/{test_adapter.rb → adapter_test.rb} +5 -1
- data/test/{test_database_tasks.rb → database_tasks_test.rb} +0 -0
- data/test/{test_system.rb → system_test.rb} +0 -0
- metadata +26 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2c2d5e512ff9f9dc96f2cae3918cb358ccf8285
|
4
|
+
data.tar.gz: 39ce06e01993e31cd1eea228ffb5c5c7b9efadb0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58c0d0c0684ba5b27906c21235fcac6e901fc2ab7ac905b1e9b83fbe5bd37de7b88870f518fa9d60f53a74a6509821d8f45d48f52ae29be219cbc0a0a361da81
|
7
|
+
data.tar.gz: 3a6ffbb7e5d08eb1e0049c3e4e19d25a4daf539c989a3da0f0dd1cf29391a212350dccbfe6ce68e8c64b54283b24277a8763fc9809859f49a0e452f8c3f415c2
|
data/README.md
CHANGED
@@ -113,4 +113,4 @@ It requires JDBC 4.0 driver and Java 6.
|
|
113
113
|
|
114
114
|
## Dependency
|
115
115
|
|
116
|
-
You can embed the JTOpen driver in your application. It is distributed in a separate gem : 'as400-
|
116
|
+
You can embed the JTOpen driver in your application. It is distributed in a separate gem : '[jdbc-as400](http://rubygems.org/gems/jdbc-as400)'
|
data/Rakefile
CHANGED
data/lib/arjdbc/as400/adapter.rb
CHANGED
@@ -48,13 +48,16 @@ module ArJdbc
|
|
48
48
|
db2_schema
|
49
49
|
end
|
50
50
|
|
51
|
-
|
52
|
-
|
53
|
-
if
|
54
|
-
|
55
|
-
|
56
|
-
|
51
|
+
def tables(name = nil)
|
52
|
+
# Do not perform search on all system
|
53
|
+
if system_naming?
|
54
|
+
name ||= current_library
|
55
|
+
unless name
|
56
|
+
raise StandardError.new('Unable to retrieve tables without current library')
|
57
|
+
end
|
57
58
|
end
|
59
|
+
|
60
|
+
@connection.tables(nil, name)
|
58
61
|
end
|
59
62
|
|
60
63
|
# Prevent migration in QGPL
|
@@ -72,6 +75,9 @@ module ArJdbc
|
|
72
75
|
# @override
|
73
76
|
def rename_column(table_name, column_name, new_column_name)
|
74
77
|
column = columns(table_name, column_name).find { |column| column.name == column_name.to_s}
|
78
|
+
unless column
|
79
|
+
raise ActiveRecord::ActiveRecordError, "No such column: #{table_name}.#{column_name}"
|
80
|
+
end
|
75
81
|
add_column(table_name, new_column_name, column.type, column.instance_values)
|
76
82
|
execute("UPDATE #{quote_table_name(table_name)} SET #{quote_column_name(new_column_name)} = #{quote_column_name(column_name)} WITH NC")
|
77
83
|
remove_column(table_name, column_name)
|
@@ -43,6 +43,10 @@ class TestAdapter < Test::Unit::TestCase
|
|
43
43
|
connection.execute('CREATE TABLE test_table (test_column INTEGER)')
|
44
44
|
connection.execute('INSERT INTO test_table(test_column) VALUES(1)')
|
45
45
|
|
46
|
+
assert_raise do
|
47
|
+
connection.rename_column('test_table', 'no_column', '')
|
48
|
+
end
|
49
|
+
|
46
50
|
connection.rename_column('test_table', 'test_column', 'new_test_column')
|
47
51
|
assert_not_nil(connection.columns('test_table').find { |column| column.name == 'new_test_column' })
|
48
52
|
assert_equal(connection.select_one('SELECT new_test_column FROM test_table')['new_test_column'], 1)
|
@@ -55,4 +59,4 @@ class TestAdapter < Test::Unit::TestCase
|
|
55
59
|
assert_equal(connection.transaction_isolation_levels.fetch(:no_commit), 'NO COMMIT')
|
56
60
|
end
|
57
61
|
|
58
|
-
end
|
62
|
+
end
|
File without changes
|
File without changes
|
metadata
CHANGED
@@ -1,85 +1,85 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-jdbcas400-adapter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Sieger, Ola Bini, Pierrick Rouxel and JRuby contributors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-12-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: activerecord-jdbc-adapter
|
15
|
-
version_requirements: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - '>='
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 1.3.9
|
20
14
|
requirement: !ruby/object:Gem::Requirement
|
21
15
|
requirements:
|
22
16
|
- - '>='
|
23
17
|
- !ruby/object:Gem::Version
|
24
18
|
version: 1.3.9
|
19
|
+
name: activerecord-jdbc-adapter
|
25
20
|
prerelease: false
|
26
21
|
type: :runtime
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: bundler
|
29
22
|
version_requirements: !ruby/object:Gem::Requirement
|
30
23
|
requirements:
|
31
|
-
- -
|
24
|
+
- - '>='
|
32
25
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
26
|
+
version: 1.3.9
|
27
|
+
- !ruby/object:Gem::Dependency
|
34
28
|
requirement: !ruby/object:Gem::Requirement
|
35
29
|
requirements:
|
36
30
|
- - ~>
|
37
31
|
- !ruby/object:Gem::Version
|
38
32
|
version: '1.5'
|
33
|
+
name: bundler
|
39
34
|
prerelease: false
|
40
35
|
type: :development
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: rake
|
43
36
|
version_requirements: !ruby/object:Gem::Requirement
|
44
37
|
requirements:
|
45
|
-
- -
|
38
|
+
- - ~>
|
46
39
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
40
|
+
version: '1.5'
|
41
|
+
- !ruby/object:Gem::Dependency
|
48
42
|
requirement: !ruby/object:Gem::Requirement
|
49
43
|
requirements:
|
50
44
|
- - '>='
|
51
45
|
- !ruby/object:Gem::Version
|
52
46
|
version: '0'
|
47
|
+
name: rake
|
53
48
|
prerelease: false
|
54
49
|
type: :development
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: test-unit
|
57
50
|
version_requirements: !ruby/object:Gem::Requirement
|
58
51
|
requirements:
|
59
52
|
- - '>='
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
62
56
|
requirement: !ruby/object:Gem::Requirement
|
63
57
|
requirements:
|
64
58
|
- - '>='
|
65
59
|
- !ruby/object:Gem::Version
|
66
60
|
version: '0'
|
61
|
+
name: test-unit
|
67
62
|
prerelease: false
|
68
63
|
type: :development
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: jdbc-as400
|
71
64
|
version_requirements: !ruby/object:Gem::Requirement
|
72
65
|
requirements:
|
73
66
|
- - '>='
|
74
67
|
- !ruby/object:Gem::Version
|
75
68
|
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
76
70
|
requirement: !ruby/object:Gem::Requirement
|
77
71
|
requirements:
|
78
72
|
- - '>='
|
79
73
|
- !ruby/object:Gem::Version
|
80
74
|
version: '0'
|
75
|
+
name: jdbc-as400
|
81
76
|
prerelease: false
|
82
77
|
type: :development
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
83
|
description: Install this gem to use AS/400 with JRuby on Rails.
|
84
84
|
email: nick@nicksieger.com, ola.bini@gmail.com
|
85
85
|
executables: []
|
@@ -96,10 +96,10 @@ files:
|
|
96
96
|
- lib/arjdbc/as400/adapter.rb
|
97
97
|
- lib/arjdbc/as400/connection_methods.rb
|
98
98
|
- lib/arjdbc/as400/system.rb
|
99
|
-
- test/
|
100
|
-
- test/
|
99
|
+
- test/adapter_test.rb
|
100
|
+
- test/database_tasks_test.rb
|
101
|
+
- test/system_test.rb
|
101
102
|
- test/test_helper.rb
|
102
|
-
- test/test_system.rb
|
103
103
|
homepage: https://github.com/pierrickrouxel/activerecord-jdbcas400-adapter
|
104
104
|
licenses:
|
105
105
|
- ''
|
@@ -125,7 +125,7 @@ signing_key:
|
|
125
125
|
specification_version: 4
|
126
126
|
summary: AS/400 JDBC adapter for JRuby on Rails.
|
127
127
|
test_files:
|
128
|
-
- test/
|
129
|
-
- test/
|
128
|
+
- test/adapter_test.rb
|
129
|
+
- test/database_tasks_test.rb
|
130
|
+
- test/system_test.rb
|
130
131
|
- test/test_helper.rb
|
131
|
-
- test/test_system.rb
|