activerecord-sqlserver-adapter 4.2.13 → 4.2.15

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: ff8552fbdd52b41994d42f30eb3b90d3c52a526a
4
- data.tar.gz: b9479141228c29d2c3a18de6f560e18616d46d3d
3
+ metadata.gz: 1d48925cc69817fb38f75ba9ce678d5df931b7d7
4
+ data.tar.gz: f0cd00edff4e8b9fb009b239368c8cb799e48e66
5
5
  SHA512:
6
- metadata.gz: 433e09b8658a56f247b23116481bd9fe367ef2ab90de2514cd6ccc34d6f9b3a6880bc13d674e07d02f001009d672c2140a86e8c3025066ae3b9588163109cef9
7
- data.tar.gz: 3e797c22d81e5df9c21510411b77c04edf24488b8c11bb437e3fc7c9c979e31381831faa906da44c088c3a8ffd6561fe0b75421bd172f21fac49dbde44f68f2f
6
+ metadata.gz: 43b840b4991b0584ab46219d2d427adbd28b3c67586726b8367ac124927b3fb05d99ba4034706c4486df66a00dffdd731fc3b1d9cad36be35b0da747e912a1c6
7
+ data.tar.gz: 09c590c4c7e253e493c130addfee719741b308f453274ecfce1f3da4a4ecc770cf91e18e7600325bf6d89c273e6c6e47070be433502e71ea25d5b92d015da4c6
@@ -1,3 +1,18 @@
1
+ ## v4.2.15
2
+
3
+ #### Fixed
4
+
5
+ * Removed errand puts statment from database tasks.
6
+ * Fix quoting of non-national columns.
7
+
8
+
9
+ ## v4.2.14
10
+
11
+ #### Fixed
12
+
13
+ * Fix rescue constants for optional connection gems. Fixes #475.
14
+
15
+
1
16
  ## v4.2.13
2
17
 
3
18
  #### Fixed
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.2.13
1
+ 4.2.15
@@ -3,7 +3,7 @@ init:
3
3
  - SET PATH=C:\MinGW\msys\1.0\bin;%PATH%
4
4
  - SET RAKEOPT=-rdevkit
5
5
  - SET TESTOPTS='-v'
6
- - SET TINYTDS_VERSION=1.0.3
6
+ - SET TINYTDS_VERSION=1.0.4
7
7
  clone_depth: 5
8
8
  skip_tags: true
9
9
  matrix:
@@ -21,7 +21,7 @@ module ActiveRecord
21
21
  end
22
22
 
23
23
  def quoted
24
- "'#{@value}'"
24
+ "'#{Utils.quote_string(@value)}'"
25
25
  end
26
26
 
27
27
  def to_s
@@ -133,7 +133,7 @@ module ActiveRecord
133
133
  return false unless @connection
134
134
  raw_connection_do 'SELECT 1'
135
135
  true
136
- rescue TinyTds::Error, ODBC::Error
136
+ rescue *connection_errors
137
137
  false
138
138
  end
139
139
 
@@ -307,6 +307,13 @@ module ActiveRecord
307
307
  configure_connection
308
308
  end
309
309
 
310
+ def connection_errors
311
+ @connection_errors ||= [].tap do |errors|
312
+ errors << TinyTds::Error if defined?(TinyTds::Error)
313
+ errors << ODBC::Error if defined?(ODBC::Error)
314
+ end
315
+ end
316
+
310
317
  def dblib_connect(config)
311
318
  TinyTds::Client.new(
312
319
  dataserver: config[:dataserver],
@@ -61,7 +61,6 @@ module ActiveRecord
61
61
  command.concat(table_args)
62
62
  view_args = connection.views.map { |v| Shellwords.escape(v) }
63
63
  command.concat(view_args)
64
- puts command.inspect
65
64
  raise 'Error dumping database' unless Kernel.system(command.join(' '))
66
65
  dump = File.read(filename)
67
66
  dump.gsub!(/^USE .*$\nGO\n/, '') # Strip db USE statements
@@ -125,6 +125,16 @@ class SpecificSchemaTestSQLServer < ActiveRecord::TestCase
125
125
  assert_sql(/@0 = 'T'/) { SSTestDatatypeMigration.where(varchar_col: 'T').first }
126
126
  end
127
127
 
128
+ it 'can update and hence properly quoted non-national char/varchar columns' do
129
+ o = SSTestDatatypeMigration.create!
130
+ o.varchar_col = "O'Reilly"
131
+ o.save!
132
+ o.reload.varchar_col.must_equal "O'Reilly"
133
+ o.varchar_col = nil
134
+ o.save!
135
+ o.reload.varchar_col.must_be_nil
136
+ end
137
+
128
138
  # With column names that have spaces
129
139
 
130
140
  it 'create record using a custom attribute reader and be able to load it back in' do
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.13
4
+ version: 4.2.15
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: 2016-05-19 00:00:00.000000000 Z
17
+ date: 2016-05-30 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: activerecord
@@ -251,3 +251,4 @@ test_files:
251
251
  - test/support/paths_sqlserver.rb
252
252
  - test/support/rake_helpers.rb
253
253
  - test/support/sql_counter_sqlserver.rb
254
+ has_rdoc: