activerecord-jdbc-adapter 50.7-java → 50.8-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: e43eceb4342dcd38df2afea30c399188280b41a7b0fc5634117757ba233a249e
4
- data.tar.gz: bc5338e82c5ae9b18049d45b91babb0a7810c79f2bec0b78e4394adff9f375dc
3
+ metadata.gz: 5478648fcae62c384d0b8aeb74486d827353baa4560835bf589048bd20050da3
4
+ data.tar.gz: 12d6e871274580e3dcbdf76e6b64daddae45fbd77c7bc7673e0f1416bd1a06c5
5
5
  SHA512:
6
- metadata.gz: 6812c7e72ea43a931867455a61cd98a7f2cceb762fa54d276b9faebfa4d40cf10f0e3b0027891b39d1f914c6b6fcf77fdebfd02ef2544a2bd4f7b2b34ba12ff7
7
- data.tar.gz: f13820dd1ea903f1e653e6fb260a2ccfc79248a8fded725ba6452bc0bb9169017423a111cb73525b12c15a48fe2009d6ee9c57122e2eeb419aef726cdeeb1243
6
+ metadata.gz: e9ae9c43b64186aa46d3df3e0e395778577f1db175fc84ea812687392b9a0437ef66ae4fdb42e7bfff717795dd1b0d93d2cf56944b7467f7fe222ecb6c6495b9
7
+ data.tar.gz: fe36ac65f5deb2e83bf8480c12292db537bc3ca5184c390495d8a459c1a91c2be4c5aa8ffa4ae8d5888a003eb74ece8b94e513e654f011670362a4c57a9d3a78
@@ -1,3 +1,3 @@
1
1
  module ArJdbc
2
- VERSION = '50.7'
2
+ VERSION = '50.8'
3
3
  end
@@ -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: '50.7'
4
+ version: '50.8'
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