activerecord-jdbc-alt-adapter 52.5.1-java → 52.6.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: af6cc4c4563f32b39f0ddac72fbfa090de13e23eefba9a95c14221787478f132
4
- data.tar.gz: cc6754a427170292ebee5a56201bef82a3dd10cbf2034aff2e8e9d8b52575243
3
+ metadata.gz: 0bbef112a6aaadd08c19169b2e2b1826e99a44f38f2d2b2e3b441383ab95b91b
4
+ data.tar.gz: 444be17b783f8b937d57cdbd47260b79f4d69a75117523b4848ec9171d082c85
5
5
  SHA512:
6
- metadata.gz: 91fff9a0aabfb206c84759e0370d92a9e843bc8b6271d38adde65292b534052a4bcc20b1a9d454ea40b28feef2b453f7b1c1a0aac12ae4c06625d71ac72164e0
7
- data.tar.gz: e66da4371d5fc890788b6cfb3c7c483e7e7f7c706aba84195495b97ae3d5438353fefef852a4aee24bca044d6b3c75315f32f1f68f194cdbd299bb92ff3fc27c
6
+ metadata.gz: bc41292328eb23e4d84a13fcc5213c1a44780ee974c207b930ca17357304f7feef2497a3642c231ef350d91d371e631a108e72d74da8d5c734d5f3194257c76c
7
+ data.tar.gz: d2a6656b88aa2432a54b9de7b27066847136de6857b6848901d3f3551dd65f5aa92787dfc9f83c7e44195509faf86416eb59ef9a04627499dc4883388882df04
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
+ pik.sh
38
+ .ruby-version
data/README.md CHANGED
@@ -8,9 +8,9 @@ use the [original adapter](https://github.com/jruby/active)
8
8
  This adapter only works with JRuby and it is advised to install the latest
9
9
  stable versions of Rails
10
10
 
11
- - For Rails `5.0.7.2` install the `50.3.1` version of this adapter
12
- - For Rails `5.1.7` install the `51.3.0` version of this adapter
13
- - For Rails `5.2.3` install the `52.2.0` version of this adapter
11
+ - For Rails `5.0.7` install the `50.7.0` version of this adapter
12
+ - For Rails `5.1.7` install the `51.7.0` version of this adapter
13
+ - For Rails `5.2.4` install the `52.6.0` version of this adapter
14
14
 
15
15
  Support for Rails 6.0 is planned in the future.
16
16
 
@@ -24,8 +24,8 @@ Add the following to your `Gemfile`:
24
24
  ```ruby
25
25
  platforms :jruby do
26
26
  # Use jdbc as the database for Active Record
27
- gem 'activerecord-jdbc-alt-adapter', '~> 50.3.1', require: 'arjdbc'
28
- gem 'jdbc-mssql', '~> 0.6.0'
27
+ gem 'activerecord-jdbc-alt-adapter', '~> 52.6.0'
28
+ gem 'jdbc-mssql', '~> 0.9.0'
29
29
  end
30
30
  ```
31
31
 
@@ -1,3 +1,3 @@
1
1
  module ArJdbc
2
- VERSION = '52.5.1'
2
+ VERSION = '52.6.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
@@ -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,
@@ -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: 52.5.1
4
+ version: 52.6.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.2.3
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
  - - "~>"
@@ -273,8 +273,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
273
273
  - !ruby/object:Gem::Version
274
274
  version: '0'
275
275
  requirements: []
276
- rubyforge_project:
277
- rubygems_version: 2.7.10
276
+ rubygems_version: 3.0.6
278
277
  signing_key:
279
278
  specification_version: 4
280
279
  summary: ActiveRecord JDBC adapter, for use within JRuby on Rails and SQL Server