activerecord-jdbc-alt-adapter 51.6.1-java → 51.7.0-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 702009f519e77be11a93e74ea20353457520f2bfaca9c41e2529e5afdcf2bf1f
4
- data.tar.gz: d51e6375921e3dac45287f44a805d3630c211a7ea9478dde72007d31562334ef
3
+ metadata.gz: 9bac3f491bd6e25ce779db381c70f8de2bcfc566f7d7add71c73453d4b9d96da
4
+ data.tar.gz: 5e3cdf41dde39ac86a39d6d21057ede60c0fa321aa9e1164cc5c13c1b6584800
5
5
  SHA512:
6
- metadata.gz: 03f3788b08fef76b0d2fa8993fade744cc9016c46740c1062169af153a495b122547f22e7f10dfa37071d83721e21edeaccd6c1091a854bd95c5644d8597b230
7
- data.tar.gz: 84b573ddc62bce351b592ce3ae1535184a417745e6d8025eddda8ea20909e6d71d33b945ce590d43337cc7d9c15864047bc8522d18b96e7043240b96373d38ed
6
+ metadata.gz: 28c69d682d31b0c159bf4fbc309699c0c362696e7edff789e1a51304284407dd09f4f63bf0d97bd460616378b3456cad4535c7fef4c19d607a92ccb962c8d80d
7
+ data.tar.gz: d83167a275cc51a6715f9a019d8df7519c6bb35d531466fe2e0c61191150238f20c70f9ae233a85e5ad31f89ae61b2f28d9c1fb2b7a17e2591c2ca2ccf529b1b
data/.gitignore CHANGED
@@ -34,3 +34,5 @@ activerecord-jdbc.iml
34
34
  lib/arjdbc/jdbc/adapter_java.jar
35
35
  .jrubyrc
36
36
  tags
37
+ .ruby-version
38
+ pik.sh
@@ -1,3 +1,3 @@
1
1
  module ArJdbc
2
- VERSION = '51.6.1'
2
+ VERSION = '51.7.0'
3
3
  end
@@ -1,6 +1,6 @@
1
1
  namespace :'tomcat-jndi' do # contains a FS JNDI impl (for tests)
2
2
 
3
- TOMCAT_MAVEN_REPO = 'http://repo2.maven.org/maven2/org/apache/tomcat'
3
+ TOMCAT_MAVEN_REPO = 'https://repo1.maven.org/maven2/org/apache/tomcat'
4
4
  TOMCAT_VERSION = '7.0.54'
5
5
 
6
6
  DOWNLOAD_DIR = File.expand_path('../test/jars', File.dirname(__FILE__))
@@ -48,4 +48,4 @@ namespace :'tomcat-jndi' do # contains a FS JNDI impl (for tests)
48
48
  rm jar_path if File.exist?(jar_path)
49
49
  end
50
50
 
51
- end
51
+ end
@@ -203,6 +203,57 @@ public class MSSQLRubyJdbcConnection extends RubyJdbcConnection {
203
203
  });
204
204
  }
205
205
 
206
+ /**
207
+ * Executes an INSERT SQL statement
208
+ * @param context
209
+ * @param sql
210
+ * @param pk Rails PK
211
+ * @return ActiveRecord::Result
212
+ * @throws SQLException
213
+ */
214
+ @Override
215
+ @JRubyMethod(name = "execute_insert_pk", required = 2)
216
+ public IRubyObject execute_insert_pk(final ThreadContext context, final IRubyObject sql, final IRubyObject pk) {
217
+
218
+ // MSSQL does not like composite primary keys here so chop it if there is more than one column
219
+ IRubyObject modifiedPk = pk;
220
+
221
+ if (pk instanceof RubyArray) {
222
+ RubyArray ary = (RubyArray) pk;
223
+ if (ary.size() > 0) {
224
+ modifiedPk = ary.eltInternal(0);
225
+ }
226
+ }
227
+
228
+ return super.execute_insert_pk(context, sql, modifiedPk);
229
+ }
230
+
231
+ /**
232
+ * Executes an INSERT SQL statement using a prepared statement
233
+ * @param context
234
+ * @param sql
235
+ * @param binds RubyArray of values to be bound to the query
236
+ * @param pk Rails PK
237
+ * @return ActiveRecord::Result
238
+ * @throws SQLException
239
+ */
240
+ @Override
241
+ @JRubyMethod(name = "execute_insert_pk", required = 3)
242
+ public IRubyObject execute_insert_pk(final ThreadContext context, final IRubyObject sql, final IRubyObject binds,
243
+ final IRubyObject pk) {
244
+ // MSSQL does not like composite primary keys here so chop it if there is more than one column
245
+ IRubyObject modifiedPk = pk;
246
+
247
+ if (pk instanceof RubyArray) {
248
+ RubyArray ary = (RubyArray) pk;
249
+ if (ary.size() > 0) {
250
+ modifiedPk = ary.eltInternal(0);
251
+ }
252
+ }
253
+
254
+ return super.execute_insert_pk(context, sql, binds, modifiedPk);
255
+ }
256
+
206
257
  @Override
207
258
  protected Integer jdbcTypeFor(final String type) {
208
259
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-jdbc-alt-adapter
3
3
  version: !ruby/object:Gem::Version
4
- version: 51.6.1
4
+ version: 51.7.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-12-22 00:00:00.000000000 Z
11
+ date: 2021-01-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -20,8 +20,8 @@ dependencies:
20
20
  - !ruby/object:Gem::Version
21
21
  version: 5.1.7
22
22
  name: activerecord
23
- prerelease: false
24
23
  type: :runtime
24
+ prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - "~>"
@@ -270,8 +270,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
270
270
  - !ruby/object:Gem::Version
271
271
  version: '0'
272
272
  requirements: []
273
- rubyforge_project:
274
- rubygems_version: 2.7.10
273
+ rubygems_version: 3.0.6
275
274
  signing_key:
276
275
  specification_version: 4
277
276
  summary: ActiveRecord JDBC adapter, for use within JRuby on Rails and SQL Server