activerecord-jdbc-adapter 60.2-java → 60.3-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: cd9e15552e3b9f6f65c66efeee8c74f9b97866ce5f6529ca39b20272d5b30523
4
- data.tar.gz: 0aa62947429e9c330b35331f5bb77af6d551d746ce726ca7854018a0ce8fd29e
3
+ metadata.gz: bf04f9e685826e3b3223a05c1ba13840c9868daa925f753c5380dd9eaebbc9a3
4
+ data.tar.gz: 189f9fc33999fb44e515d3ccf808233f97b15da048b4dd0f94c362aca4255ba6
5
5
  SHA512:
6
- metadata.gz: f1852d21daa1321cc311d33362d605dcac55c691dd5912755727e5f3809fdcf3cb487b4eb4384d98eb05f9464e30b0dddf003ef7ca297bc94cf02446e45620c6
7
- data.tar.gz: 9221932463a324cdf0058d382d86ebc3b90c91fc5a00d3fd4d0bbe51bb8bd0ad03ff9457c0a7cf80ec531ce534de875a3bffdc25b4a4cec773b253df12b85774
6
+ metadata.gz: 1d674426d577a2a382a0216500318fe0065a7e415a846a0d37df883d3f2919e8f3803e872255ba58bf3c7ac023826ed3ee02e35f306ee9970aa4140094583f88
7
+ data.tar.gz: 883526f8298928d7e60df7575cd173d7a0e447a7f8ff81172332313167feb8fbc63e077b86c3d4a81a7fafc174843f001b073eca8f9bc734d17cd92debc043f7
@@ -1,3 +1,3 @@
1
1
  module ArJdbc
2
- VERSION = '60.2'
2
+ VERSION = '60.3'
3
3
  end
@@ -2165,7 +2165,7 @@ public class RubyJdbcConnection extends RubyObject {
2165
2165
  return RubyString.newString(runtime, DateTimeUtils.dateToString(value));
2166
2166
  }
2167
2167
 
2168
- return DateTimeUtils.newDateAsTime(context, value, null).callMethod(context, "to_date");
2168
+ return DateTimeUtils.newDateAsTime(context, value, DateTimeZone.UTC).callMethod(context, "to_date");
2169
2169
  }
2170
2170
 
2171
2171
  protected IRubyObject timeToRuby(final ThreadContext context,
@@ -200,6 +200,57 @@ public class MSSQLRubyJdbcConnection extends RubyJdbcConnection {
200
200
  });
201
201
  }
202
202
 
203
+ /**
204
+ * Executes an INSERT SQL statement
205
+ * @param context
206
+ * @param sql
207
+ * @param pk Rails PK
208
+ * @return ActiveRecord::Result
209
+ * @throws SQLException
210
+ */
211
+ @Override
212
+ @JRubyMethod(name = "execute_insert_pk", required = 2)
213
+ public IRubyObject execute_insert_pk(final ThreadContext context, final IRubyObject sql, final IRubyObject pk) {
214
+
215
+ // MSSQL does not like composite primary keys here so chop it if there is more than one column
216
+ IRubyObject modifiedPk = pk;
217
+
218
+ if (pk instanceof RubyArray) {
219
+ RubyArray ary = (RubyArray) pk;
220
+ if (ary.size() > 0) {
221
+ modifiedPk = ary.eltInternal(0);
222
+ }
223
+ }
224
+
225
+ return super.execute_insert_pk(context, sql, modifiedPk);
226
+ }
227
+
228
+ /**
229
+ * Executes an INSERT SQL statement using a prepared statement
230
+ * @param context
231
+ * @param sql
232
+ * @param binds RubyArray of values to be bound to the query
233
+ * @param pk Rails PK
234
+ * @return ActiveRecord::Result
235
+ * @throws SQLException
236
+ */
237
+ @Override
238
+ @JRubyMethod(name = "execute_insert_pk", required = 3)
239
+ public IRubyObject execute_insert_pk(final ThreadContext context, final IRubyObject sql, final IRubyObject binds,
240
+ final IRubyObject pk) {
241
+ // MSSQL does not like composite primary keys here so chop it if there is more than one column
242
+ IRubyObject modifiedPk = pk;
243
+
244
+ if (pk instanceof RubyArray) {
245
+ RubyArray ary = (RubyArray) pk;
246
+ if (ary.size() > 0) {
247
+ modifiedPk = ary.eltInternal(0);
248
+ }
249
+ }
250
+
251
+ return super.execute_insert_pk(context, sql, binds, modifiedPk);
252
+ }
253
+
203
254
  @Override
204
255
  protected Integer jdbcTypeFor(final String type) {
205
256
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-jdbc-adapter
3
3
  version: !ruby/object:Gem::Version
4
- version: '60.2'
4
+ version: '60.3'
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: 2020-04-29 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