activerecord-jdbc-adapter 60.0-java → 61.0-java

Sign up to get free protection for your applications and to get access to all the features.
@@ -370,10 +370,9 @@ public class SQLite3RubyJdbcConnection extends RubyJdbcConnection {
370
370
  }
371
371
 
372
372
  @Override
373
- public IRubyObject begin(ThreadContext context, IRubyObject level) {
374
- throw context.runtime.newRaiseException(getTransactionIsolationError(context.runtime),
375
- "SQLite3 does not support isolation levels"
376
- );
373
+ protected boolean resetSavepoints(final ThreadContext context, final Connection connection) throws SQLException {
374
+ connection.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);
375
+ return super.resetSavepoints(context, connection);
377
376
  }
378
377
 
379
378
  @Override
@@ -37,6 +37,7 @@ import org.jruby.Ruby;
37
37
  import org.jruby.RubyFloat;
38
38
  import org.jruby.RubyString;
39
39
  import org.jruby.RubyTime;
40
+ import org.jruby.ext.date.RubyDateTime;
40
41
  import org.jruby.javasupport.Java;
41
42
  import org.jruby.runtime.Block;
42
43
  import org.jruby.runtime.ThreadContext;
@@ -632,14 +633,21 @@ public abstract class DateTimeUtils {
632
633
  */
633
634
  public static String timestampTimeToString(final ThreadContext context,
634
635
  final IRubyObject value, DateTimeZone zone, boolean withZone) {
635
- RubyTime timeValue = toTime(context, value);
636
- DateTime dt = timeValue.getDateTime();
636
+ DateTime dt;
637
+ int usec = 0;
638
+ if (value instanceof RubyDateTime) {
639
+ dt = ((RubyDateTime) value).getDateTime();
640
+ } else {
641
+ RubyTime timeValue = toTime(context, value);
642
+ dt = timeValue.getDateTime();
643
+ usec = (int) timeValue.getUSec();
644
+ }
637
645
 
638
646
  StringBuilder sb = new StringBuilder(36);
639
647
 
640
648
  int year = dt.getYear();
641
649
  if (year <= 0) {
642
- year--;
650
+ if (!(value instanceof RubyDateTime)) year--;
643
651
  } else if (zone != null) {
644
652
  dt = dateTimeInZone(dt, zone);
645
653
  year = dt.getYear();
@@ -659,7 +667,7 @@ public abstract class DateTimeUtils {
659
667
  if (year < 0) sb.append(" BC");
660
668
  sb.append(' ');
661
669
 
662
- appendTime(sb, chrono, millis, (int) timeValue.getUSec(), withZone);
670
+ appendTime(sb, chrono, millis, usec, withZone);
663
671
 
664
672
  return sb.toString();
665
673
  }
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-jdbc-adapter
3
3
  version: !ruby/object:Gem::Version
4
- version: '60.0'
4
+ version: '61.0'
5
5
  platform: java
6
6
  authors:
7
7
  - Nick Sieger, Ola Bini, Karol Bucek and JRuby contributors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-01 00:00:00.000000000 Z
11
+ date: 2020-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
16
  - - "~>"
17
17
  - !ruby/object:Gem::Version
18
- version: 6.0.0
18
+ version: 6.1.0
19
19
  name: activerecord
20
- prerelease: false
21
20
  type: :runtime
21
+ prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 6.0.0
26
+ version: 6.1.0
27
27
  description: 'AR-JDBC is a database adapter for Rails'' ActiveRecord component designed
28
28
  to be used with JRuby built upon Java''s JDBC API for database access. Provides
29
29
  (ActiveRecord) built-in adapters: MySQL, PostgreSQL, SQLite3, and SQLServer.'
@@ -230,8 +230,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
230
230
  - !ruby/object:Gem::Version
231
231
  version: '0'
232
232
  requirements: []
233
- rubyforge_project:
234
- rubygems_version: 2.7.10
233
+ rubygems_version: 3.0.6
235
234
  signing_key:
236
235
  specification_version: 4
237
236
  summary: JDBC adapter for ActiveRecord, for use within JRuby on Rails.