activerecord-sqlserver-adapter 4.2.2 → 4.2.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f5811725caa7db8c0ded035b59882c3e2826b6a6
4
- data.tar.gz: 0637b1351f167da700e236db923a624fe0a35a98
3
+ metadata.gz: 1c8606998a19306cd6a40b95820dcfc2f1f84982
4
+ data.tar.gz: 1890a0231b4a9c1e3545b5171d0e84fa2461d72a
5
5
  SHA512:
6
- metadata.gz: bfef051e6a63017c57bd179dfebb7d04ab612b1a008caabe86b7a2281093a713aa302781a17f9f735f6da8ae046ebd9f9648244aa50f1ce1569ce4e518e99a6b
7
- data.tar.gz: d0e8537fbc6a3be2f406e18ac6aa64e9e5e2eec51d0aaaed57469104bdb98652cff1b8647d7f0e6d913422273463143ff7e3ba4fc315bcf90211f5436a5eb2fb
6
+ metadata.gz: 13d82553f8f91bfd76b755b925b3098b3882ed0921288ef9cf117d9edd68f60cd981d984e2d4831a51b64b0737a2d39f7b879a27b77e4746f9a9b61db76bc56d
7
+ data.tar.gz: c06d4c021c47236b83d79a132a19e72b89f7fc7fcb4dcd62751a63c858eafb8a28f9c4d01f566abcddb75a32dcb8229f29b9a874d6fbbd3afa7e5fd1c8ae9eff
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## v4.2.3
2
+
3
+ * Fix SET defaults when using Azure.
4
+ * Test insert 4-byte unicode chars.
5
+ * Make rollback transaction transcount aware for implicit error rollbacks. Fixes #390
6
+
1
7
 
2
8
  ## v4.2.2
3
9
 
@@ -66,7 +66,7 @@ module ActiveRecord
66
66
  end
67
67
 
68
68
  def rollback_db_transaction
69
- do_execute 'ROLLBACK TRANSACTION'
69
+ do_execute 'IF @@TRANCOUNT > 0 ROLLBACK TRANSACTION'
70
70
  end
71
71
 
72
72
  include Savepoints
@@ -3,7 +3,7 @@ module ActiveRecord
3
3
  module SQLServer
4
4
  module Version
5
5
 
6
- VERSION = '4.2.2'
6
+ VERSION = '4.2.3'
7
7
 
8
8
  end
9
9
  end
@@ -297,7 +297,7 @@ module ActiveRecord
297
297
  client.execute('SET ANSI_NULL_DFLT_ON ON').do
298
298
  client.execute('SET IMPLICIT_TRANSACTIONS OFF').do
299
299
  client.execute('SET ANSI_PADDING ON').do
300
- client.execute('SET QUOTED_IDENTIFIER ON')
300
+ client.execute('SET QUOTED_IDENTIFIER ON').do
301
301
  client.execute('SET ANSI_WARNINGS ON').do
302
302
  else
303
303
  client.execute('SET ANSI_DEFAULTS ON').do
@@ -33,6 +33,13 @@ module ActiveRecord
33
33
  ActiveRecord::Base.connection
34
34
  end
35
35
 
36
+ def with_use_output_inserted_disabled
37
+ ActiveRecord::ConnectionAdapters::SQLServerAdapter.use_output_inserted = false
38
+ yield
39
+ ensure
40
+ ActiveRecord::ConnectionAdapters::SQLServerAdapter.use_output_inserted = true
41
+ end
42
+
36
43
  end
37
44
  end
38
45
 
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'cases/helper_sqlserver'
2
3
  require 'models/ship'
3
4
  require 'models/developer'
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'cases/helper_sqlserver'
2
3
 
3
4
  class SQLServerUuidTest < ActiveRecord::TestCase
@@ -10,6 +11,7 @@ class SQLServerUuidTest < ActiveRecord::TestCase
10
11
  end
11
12
 
12
13
  it 'can create with a new pk' do
14
+ # Type::Uuid::ACCEPTABLE_UUID
13
15
  obj = SSTestUuid.create!
14
16
  obj.id.must_be :present?
15
17
  obj.id.must_match acceptable_uuid
@@ -38,4 +40,9 @@ class SQLServerUuidTest < ActiveRecord::TestCase
38
40
  column.default_function.must_equal "newid()"
39
41
  end
40
42
 
43
+ it 'can insert even when use_output_inserted to false ' do
44
+ obj = with_use_output_inserted_disabled { SSTestUuid.create!(name: "😢") }
45
+ obj.id.must_be :nil?
46
+ end
47
+
41
48
  end
data/test/config.yml CHANGED
@@ -10,6 +10,7 @@ default_connection_info: &default_connection_info
10
10
  password: <%= ENV['ACTIVERECORD_UNITTEST_PASS'] || '' %>
11
11
  azure: <%= !ENV['ACTIVERECORD_UNITTEST_AZURE'].nil? %>
12
12
  collation: <%= ENV['ACTIVERECORD_UNITTEST_COLLATION'] || nil %>
13
+ encoding: utf8
13
14
 
14
15
  connections:
15
16
 
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.2
4
+ version: 4.2.3
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-02 00:00:00.000000000 Z
17
+ date: 2015-02-18 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: activerecord