activerecord-jdbc-alt-adapter 61.0.0-java → 61.2.0-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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dd61f85687802bf7bad5e3013413ccbda73395044d46775e8fa5f6d57e8410ca
4
- data.tar.gz: 245c8e59a5bbf3e87e7f9f0759070dda617801ce650bdb089cb1c16daa4119eb
3
+ metadata.gz: aaaf1a1ed8cb06e36bf0a6667be9ec1ce05d68a10f416449443c559be91e5fe2
4
+ data.tar.gz: 9447c46dfff607cc8a4cd177644229a55d660cecd3debb98ce123a12b4ee9704
5
5
  SHA512:
6
- metadata.gz: f11b067072016b63fa265435c90d45672463cc80e5ac1e8199bc96d209704affdc30a75d89a6ac5fb67ea5fad06c91c7ef59af87651e387beb360e64dc027e32
7
- data.tar.gz: b1e71248871946ccaa981bb0a74f08fdeba605637b020f704ae0197dad96c00947cfe0f87752f010499d6ddad9a6a97ffe7791cb6f7a0dd69e4f57f2d7643014
6
+ metadata.gz: 49cbdc1c2e924fb00c5a5ff0af6dba814c976eec8c1b1dd08fe0b8e28dd4babee04f354248ccffc73f4f8bd7f09b12360c9fe87befde93b3b89a7859a551d053
7
+ data.tar.gz: afc769af1ce09137cbeb9d714fd02791a13a71c0685747eea934ab635413d035baca60e99c9c911f5cd510c93c848fb073e79e77f4f8dcb42520fbf2267430e5
data/.travis.yml CHANGED
@@ -9,13 +9,14 @@ before_install:
9
9
  - rvm @default,@global do gem uninstall bundler -a -x -I || true
10
10
  - gem install bundler -v "~>1.17.3"
11
11
  install:
12
- - bundle install --retry 3 --without development
12
+ - bundle config set --local without 'development'
13
+ - bundle install
13
14
  # to fix this issue: https://travis-ci.community/t/mariadb-10-1-fails-to-install-on-xenial/3151/3
14
15
  - mysql -u root -e 'CREATE USER IF NOT EXISTS travis@localhost; GRANT ALL ON *.* TO travis@localhost;' || true
15
16
 
16
17
  language: ruby
17
18
  rvm:
18
- - jruby-9.2.14.0
19
+ - jruby-9.2.19.0
19
20
  jdk:
20
21
  - openjdk8
21
22
 
@@ -48,7 +49,7 @@ before_script:
48
49
 
49
50
  env:
50
51
  global:
51
- - AR_VERSION="master"
52
+ - AR_VERSION="6-1-stable"
52
53
  matrix:
53
54
  allow_failures:
54
55
  - rvm: jruby-head
Binary file
@@ -78,12 +78,15 @@ ArJdbc::ConnectionMethods.module_eval do
78
78
  url << "sendTimeAsDatetime=#{config[:send_time_as_datetime] || false};"
79
79
  url << "loginTimeout=#{config[:login_timeout].to_i};" if config[:login_timeout]
80
80
  url << "lockTimeout=#{config[:lock_timeout].to_i};"
81
+ url << "encrypt=#{config[:encrypt]};" if config.key?(:encrypt)
82
+ url << "trustServerCertificate=#{config[:trust_server_certificate]};" if config.key?(:trust_server_certificate)
81
83
  app = config[:appname] || config[:application]
82
84
  url << "applicationName=#{app};" if app
83
85
  isc = config[:integrated_security] # Win only - needs sqljdbc_auth.dll
84
86
  url << "integratedSecurity=#{isc};" unless isc.nil?
85
87
  url
86
88
  end
89
+
87
90
  jdbc_connection(config)
88
91
  end
89
92
  alias_method :jdbcsqlserver_connection, :sqlserver_connection
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ArJdbc
4
- VERSION = '61.0.0'
4
+ VERSION = '61.2.0'
5
5
  end
@@ -387,7 +387,20 @@ public class PostgreSQLRubyJdbcConnection extends arjdbc.jdbc.RubyJdbcConnection
387
387
  RubyDate rubyDate = (RubyDate) value;
388
388
  DateTime dt = rubyDate.getDateTime();
389
389
  // pgjdbc needs adjustment for default JVM timezone
390
- statement.setDate(index, new Date(dt.getMillis() - TZ_DEFAULT.getOffset(dt.getMillis())));
390
+ //
391
+ // If the date is a day when Daylight savings starts (2am changed to 3am),
392
+ // And we are in a positive GMT timezone (Australia/Melbourne)
393
+ // Then removing milliseconds equal to the TimeZone (+11 GMT),
394
+ // will result in the date being the previous day 23:00, because of the missing hour.
395
+ // So we check if the date after the shift is outside of daylight time and remove an hours worth of milliseconds.
396
+ final long dateMillis = dt.getMillis();
397
+ long offset = TZ_DEFAULT.getOffset(dt.getMillis());
398
+ if (TZ_DEFAULT.inDaylightTime(new Date(dt.getMillis())) && !TZ_DEFAULT.inDaylightTime(new Date(dateMillis - offset))) {
399
+ offset -= 3600000; // 1 hour
400
+ }
401
+ Date utcShiftedDate = new Date(dateMillis - offset);
402
+
403
+ statement.setDate(index, utcShiftedDate);
391
404
  return;
392
405
  }
393
406
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-jdbc-alt-adapter
3
3
  version: !ruby/object:Gem::Version
4
- version: 61.0.0
4
+ version: 61.2.0
5
5
  platform: java
6
6
  authors:
7
7
  - Nick Sieger, Ola Bini, Karol Bucek, Jesse Chavez, and JRuby contributors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-05 00:00:00.000000000 Z
11
+ date: 2023-02-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -266,7 +266,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
266
266
  - !ruby/object:Gem::Version
267
267
  version: '0'
268
268
  requirements: []
269
- rubygems_version: 3.1.6
269
+ rubygems_version: 3.2.29
270
270
  signing_key:
271
271
  specification_version: 4
272
272
  summary: ActiveRecord JDBC adapter, for use within JRuby on Rails and SQL Server