activerecord-sqlserver-adapter 4.2.3 → 4.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1c8606998a19306cd6a40b95820dcfc2f1f84982
4
- data.tar.gz: 1890a0231b4a9c1e3545b5171d0e84fa2461d72a
3
+ metadata.gz: 66376e3352f343f00ed459b35bd3ea825209cd66
4
+ data.tar.gz: 4b8ee4f3981be083fc8e6be1733e182bef5b3b83
5
5
  SHA512:
6
- metadata.gz: 13d82553f8f91bfd76b755b925b3098b3882ed0921288ef9cf117d9edd68f60cd981d984e2d4831a51b64b0737a2d39f7b879a27b77e4746f9a9b61db76bc56d
7
- data.tar.gz: c06d4c021c47236b83d79a132a19e72b89f7fc7fcb4dcd62751a63c858eafb8a28f9c4d01f566abcddb75a32dcb8229f29b9a874d6fbbd3afa7e5fd1c8ae9eff
6
+ metadata.gz: 35ce29a0a1666f992f6335d0d106a4317abca6891dc758f00a838292db8ddc82e318e0dbe16f6852c1c25a82bdacb44e0bf99598b321c0b4cf86664e49d6b465
7
+ data.tar.gz: 2d7490d9c29f9cc571e35daab9b5daee3fa6ba910a287b84c5dff9c906f8f9bfb595a730aa90bba4600db63ae8f553ee9df68cba4e56af8a59072b09e750ec69
@@ -1,3 +1,10 @@
1
+
2
+ ## v4.2.4
3
+
4
+ * Compatible with Rails 4.2.1.
5
+ * Fix schema limit reflection for char/varchar. Fixes #394.
6
+
7
+
1
8
  ## v4.2.3
2
9
 
3
10
  * Fix SET defaults when using Azure.
@@ -15,8 +15,9 @@ Gem::Specification.new do |spec|
15
15
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
16
16
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
17
17
  spec.require_paths = ['lib']
18
- spec.add_dependency 'activerecord', '~> 4.2.0'
18
+ spec.add_dependency 'activerecord', '~> 4.2.1'
19
19
  spec.add_development_dependency 'bundler'
20
+ spec.add_development_dependency 'guard'
20
21
  spec.add_development_dependency 'guard-minitest'
21
22
  spec.add_development_dependency 'minitest', '< 5.3.4' # PENDING: [Rails5.x] Remove test order constraint.
22
23
  spec.add_development_dependency 'minitest-focus'
@@ -65,7 +65,7 @@ module ActiveRecord
65
65
  do_execute 'COMMIT TRANSACTION'
66
66
  end
67
67
 
68
- def rollback_db_transaction
68
+ def exec_rollback_db_transaction
69
69
  do_execute 'IF @@TRANCOUNT > 0 ROLLBACK TRANSACTION'
70
70
  end
71
71
 
@@ -75,7 +75,7 @@ module ActiveRecord
75
75
  do_execute "SAVE TRANSACTION #{name}"
76
76
  end
77
77
 
78
- def rollback_to_savepoint(name = current_savepoint_name)
78
+ def exec_rollback_to_savepoint(name = current_savepoint_name)
79
79
  do_execute "ROLLBACK TRANSACTION #{name}"
80
80
  end
81
81
 
@@ -235,7 +235,7 @@ module ActiveRecord
235
235
  columns.DATETIME_PRECISION AS datetime_precision,
236
236
  columns.ordinal_position,
237
237
  CASE
238
- WHEN columns.DATA_TYPE IN ('nchar','nvarchar') THEN columns.CHARACTER_MAXIMUM_LENGTH
238
+ WHEN columns.DATA_TYPE IN ('nchar','nvarchar','char','varchar') THEN columns.CHARACTER_MAXIMUM_LENGTH
239
239
  ELSE COL_LENGTH('#{database}'+columns.TABLE_SCHEMA+'.'+columns.TABLE_NAME, columns.COLUMN_NAME)
240
240
  END AS [length],
241
241
  CASE
@@ -3,7 +3,7 @@ module ActiveRecord
3
3
  module SQLServer
4
4
  module Version
5
5
 
6
- VERSION = '4.2.3'
6
+ VERSION = '4.2.4'
7
7
 
8
8
  end
9
9
  end
@@ -46,9 +46,7 @@ class ColumnTestSQLServer < ActiveRecord::TestCase
46
46
  type.must_be :number?
47
47
  type.limit.must_equal 8
48
48
  assert_obj_set_and_save :bigint, -9_223_372_036_854_775_808
49
- assert_raises(RangeError) { new_obj.bigint = -9_223_372_036_854_775_809 }
50
49
  assert_obj_set_and_save :bigint, 9_223_372_036_854_775_807
51
- assert_raises(RangeError) { new_obj.bigint = 9_223_372_036_854_775_808 }
52
50
  end
53
51
 
54
52
  it 'int(4)' do
@@ -64,9 +62,7 @@ class ColumnTestSQLServer < ActiveRecord::TestCase
64
62
  type.must_be :number?
65
63
  type.limit.must_equal 4
66
64
  assert_obj_set_and_save :int, -2_147_483_648
67
- assert_raises(RangeError) { new_obj.int = -2_147_483_649 }
68
65
  assert_obj_set_and_save :int, 2_147_483_647
69
- assert_raises(RangeError) { new_obj.int = 2_147_483_648 }
70
66
  end
71
67
 
72
68
  it 'smallint(2)' do
@@ -82,9 +78,7 @@ class ColumnTestSQLServer < ActiveRecord::TestCase
82
78
  type.must_be :number?
83
79
  type.limit.must_equal 2
84
80
  assert_obj_set_and_save :smallint, -32_768
85
- assert_raises(RangeError) { new_obj.smallint = -32_769 }
86
81
  assert_obj_set_and_save :smallint, 32_767
87
- assert_raises(RangeError) { new_obj.smallint = 32_768 }
88
82
  end
89
83
 
90
84
  it 'tinyint(1)' do
@@ -100,9 +94,7 @@ class ColumnTestSQLServer < ActiveRecord::TestCase
100
94
  type.must_be :number?
101
95
  type.limit.must_equal 1
102
96
  assert_obj_set_and_save :tinyint, 0
103
- assert_raises(RangeError) { new_obj.tinyint = -1 }
104
97
  assert_obj_set_and_save :tinyint, 255
105
- assert_raises(RangeError) { new_obj.tinyint = 256 }
106
98
  end
107
99
 
108
100
  it 'bit' do
@@ -5,10 +5,16 @@ class SpecificSchemaTestSQLServer < ActiveRecord::TestCase
5
5
  after { SSTestEdgeSchema.delete_all }
6
6
 
7
7
  it 'handle dollar symbols' do
8
- SSTestDollarTableName.new.save
8
+ SSTestDollarTableName.create!
9
9
  SSTestDollarTableName.limit(20).offset(1)
10
10
  end
11
11
 
12
+ it 'handle dot table names' do
13
+ SSTestDotTableName.create! name: 'test'
14
+ SSTestDotTableName.limit(20).offset(1)
15
+ SSTestDotTableName.where(name: 'test').first.must_be :present?
16
+ end
17
+
12
18
  it 'models can use tinyint pk tables' do
13
19
  obj = SSTestTinyintPk.create! name: '1'
14
20
  obj.id.is_a? Fixnum
@@ -0,0 +1,3 @@
1
+ class SSTestDotTableName < ActiveRecord::Base
2
+ self.table_name = '[dbo].[some.Name]'
3
+ end
@@ -41,6 +41,10 @@ ActiveRecord::Schema.define do
41
41
  t.uuid :uuid_nil_default, default: nil
42
42
  end
43
43
 
44
+ create_table '[some.Name]', force: true do |t|
45
+ t.varchar :name
46
+ end
47
+
44
48
  create_table 'sst_my$strange_table', force: true do |t|
45
49
  t.string :name
46
50
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-sqlserver-adapter
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.3
4
+ version: 4.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ken Collins
@@ -14,7 +14,7 @@ authors:
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2015-02-18 00:00:00.000000000 Z
17
+ date: 2015-03-20 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: activerecord
@@ -22,14 +22,14 @@ dependencies:
22
22
  requirements:
23
23
  - - "~>"
24
24
  - !ruby/object:Gem::Version
25
- version: 4.2.0
25
+ version: 4.2.1
26
26
  type: :runtime
27
27
  prerelease: false
28
28
  version_requirements: !ruby/object:Gem::Requirement
29
29
  requirements:
30
30
  - - "~>"
31
31
  - !ruby/object:Gem::Version
32
- version: 4.2.0
32
+ version: 4.2.1
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: bundler
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -44,6 +44,20 @@ dependencies:
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
46
  version: '0'
47
+ - !ruby/object:Gem::Dependency
48
+ name: guard
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
47
61
  - !ruby/object:Gem::Dependency
48
62
  name: guard-minitest
49
63
  requirement: !ruby/object:Gem::Requirement
@@ -259,6 +273,7 @@ files:
259
273
  - test/models/sqlserver/datatype.rb
260
274
  - test/models/sqlserver/datatype_migration.rb
261
275
  - test/models/sqlserver/dollar_table_name.rb
276
+ - test/models/sqlserver/dot_table_name.rb
262
277
  - test/models/sqlserver/edge_schema.rb
263
278
  - test/models/sqlserver/fk_has_fk.rb
264
279
  - test/models/sqlserver/fk_has_pk.rb
@@ -333,6 +348,7 @@ test_files:
333
348
  - test/models/sqlserver/datatype.rb
334
349
  - test/models/sqlserver/datatype_migration.rb
335
350
  - test/models/sqlserver/dollar_table_name.rb
351
+ - test/models/sqlserver/dot_table_name.rb
336
352
  - test/models/sqlserver/edge_schema.rb
337
353
  - test/models/sqlserver/fk_has_fk.rb
338
354
  - test/models/sqlserver/fk_has_pk.rb