activerecord-jdbc-adapter 51.7-java → 51.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: a472f8ed7911f754bafc83ddf5d34fa061fda0d8b78a0a0d263e54ac4ae59ffa
4
- data.tar.gz: 1fd596cb2615ab284b647d6546e40eab484c9718890d0ee90e5a9220610762cc
3
+ metadata.gz: c33e6546ab301a1eda15ef885b651360416932c02d874898f4c525299f255ec8
4
+ data.tar.gz: 5dfa0451c604112c903937e165d0d43279650a5c172250edc2688573e9719932
5
5
  SHA512:
6
- metadata.gz: 7686dceb4704955a36053011ae7da81abc6384bd8ad213a171f99c2becb1d814138192f6f05923e2bfd1434e395b59e38418ffcd57ab7324d352c6a9a96b4bf2
7
- data.tar.gz: 0030c4eb8f4e61615f7d30b4a1693fa26729144e32484bfc02edccf418fe339f79736c0c4039e89a6e81159d9e45dbbf10cf18deab6bd2f5c3ee75ffa24db137
6
+ metadata.gz: 57e42a917703c855155d0ed9eba2d3a410a3d6e29c720054344f576c28510c058ba7cacf1d279757af85749188dc07d5ce53e657d4c042440fa9afa0c56d128c
7
+ data.tar.gz: d337cc0ae05de8983fbcfbaaffe1f6ef9a1eca8bc7f65f82972d5b8f9409166c3e8c745cd6be04d5eed2f7d7f997d53c41cceb2397ad39302ab598db3c433e3d
@@ -1,3 +1,3 @@
1
1
  module ArJdbc
2
- VERSION = '51.7'
2
+ VERSION = '51.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: '51.7'
4
+ version: '51.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