activerecord-jdbc-adapter 52.6-java → 52.7-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: 9c826f98de6265c91b7b4e9eedc261ff0e56256138c72d6b8983b5426a98ba39
4
- data.tar.gz: 5d5c55caa8eedc053dad096e2eff709132cf050dfc20b7c06681ae6871aa4fb7
3
+ metadata.gz: 7e10da6d252a05adeedfb0b57fbd49bb6e2b8af28df60c5005adada50ea29bc4
4
+ data.tar.gz: 18a6f90b2c900b81e9e820e7c79f6478697baa3114ebc3938d67caceacc04e79
5
5
  SHA512:
6
- metadata.gz: ce7713c92cce62c8c9813778f4eb25362f1f886ea1ec0dc44d0f89257603bd7e7c926e25acebd4ddb3b6b4c0398c89e566982c26769b2c020ac6d5449aa9eb8e
7
- data.tar.gz: c1bddfe622adf99a5260a7046f5ab704b2e3cee09047215e9554117e2260d9a1b35a704d366b08fe03e367c4780898e06348a27aca3a3604c1375bb23c6b9a68
6
+ metadata.gz: 304c31adfc470ac2852af55ecd84dab23be302df35917cdd683aeadd94c30fa86dae2b040e9b637365684f120677a5fcbbf6f8f6daa00d90f41f5ebd743f08e9
7
+ data.tar.gz: 68d730d2b58312cdc63acd4fb46e5d208436dfa6e9d2ec16086ec2c381efb5d8fc0cd6d1af7bf740e840084a26fb99489f43463d04456eef68a9c7ceb224585a
@@ -1,3 +1,3 @@
1
1
  module ArJdbc
2
- VERSION = '52.6'
2
+ VERSION = '52.7'
3
3
  end
@@ -2348,7 +2348,7 @@ public class RubyJdbcConnection extends RubyObject {
2348
2348
  return RubyString.newString(runtime, DateTimeUtils.dateToString(value));
2349
2349
  }
2350
2350
 
2351
- return DateTimeUtils.newDateAsTime(context, value, null).callMethod(context, "to_date");
2351
+ return DateTimeUtils.newDateAsTime(context, value, DateTimeZone.UTC).callMethod(context, "to_date");
2352
2352
  }
2353
2353
 
2354
2354
  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: '52.6'
4
+ version: '52.7'
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