activerecord-jdbc-alt-adapter 61.0.0-java → 61.1.0-java

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
  SHA256:
3
- metadata.gz: dd61f85687802bf7bad5e3013413ccbda73395044d46775e8fa5f6d57e8410ca
4
- data.tar.gz: 245c8e59a5bbf3e87e7f9f0759070dda617801ce650bdb089cb1c16daa4119eb
3
+ metadata.gz: 59345f12074c8042ddc27f2234fda3ed1e63a8b29610b45e42e6631621872a84
4
+ data.tar.gz: aa1ec94c11f8776a6ac82f00be956105d254d158cd88709f762dd02e3aa424eb
5
5
  SHA512:
6
- metadata.gz: f11b067072016b63fa265435c90d45672463cc80e5ac1e8199bc96d209704affdc30a75d89a6ac5fb67ea5fad06c91c7ef59af87651e387beb360e64dc027e32
7
- data.tar.gz: b1e71248871946ccaa981bb0a74f08fdeba605637b020f704ae0197dad96c00947cfe0f87752f010499d6ddad9a6a97ffe7791cb6f7a0dd69e4f57f2d7643014
6
+ metadata.gz: edaf34229e549b40849ff3ba02dd9cc00bde1d38d2dc4a5778ae4228597b0b4289e5314ba02fb7c201c6ea3b8be56f170bac91e7fd13e1cd4c82b1f49a4820c9
7
+ data.tar.gz: 02f8789a6fb0e82ececd0050c751d8bc1d71efe57363cff5bb7ee78b880c1a331418920de618ff206a77892528c26b78be5a35526432c6f17188e06cd1cdc472
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ArJdbc
4
- VERSION = '61.0.0'
4
+ VERSION = '61.1.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.1.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: 2021-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement