activerecord-jdbc-alt-adapter 51.3.0-java → 51.3.1-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/arjdbc/version.rb +1 -1
- data/src/java/arjdbc/mssql/MSSQLRubyJdbcConnection.java +16 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14951fdf9a0e78502d04e2121a0d9375a7df2f2c2799f68900f90bd35faf7e11
|
4
|
+
data.tar.gz: de5abde7fda2e40f717246a69978ea0bf9b485368e9da5415211e84a136803b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0bc89c6ebbad713b42e3ed992594f691a72faeabfc9cc5873881f145f081782c134d1615c8c2bd351306209a0ef872908180b0c1c0976957e428b1ff67eed59
|
7
|
+
data.tar.gz: 2cd4047462b8bcb01e16ba0b319c95ec6a6e12c746268564c868ed43a245da5a462e8f316ac5778021d684cb5fc40fb12b5c8f923adb05baa098d86aebd6d2d2
|
data/lib/arjdbc/version.rb
CHANGED
@@ -36,6 +36,7 @@ import java.sql.ResultSet;
|
|
36
36
|
import java.sql.Savepoint;
|
37
37
|
import java.sql.SQLException;
|
38
38
|
import java.sql.Types;
|
39
|
+
import java.sql.Date;
|
39
40
|
import java.sql.Timestamp;
|
40
41
|
import java.util.Locale;
|
41
42
|
|
@@ -305,6 +306,21 @@ public class MSSQLRubyJdbcConnection extends RubyJdbcConnection {
|
|
305
306
|
statement.setObject(index, timeStr, Types.NVARCHAR);
|
306
307
|
}
|
307
308
|
|
309
|
+
@Override
|
310
|
+
protected void setDateParameter(final ThreadContext context,
|
311
|
+
final Connection connection, final PreparedStatement statement,
|
312
|
+
final int index, IRubyObject value,
|
313
|
+
final IRubyObject attribute, final int type) throws SQLException {
|
314
|
+
|
315
|
+
if ( ! "Date".equals(value.getMetaClass().getName()) && value.respondsTo("to_date") ) {
|
316
|
+
value = value.callMethod(context, "to_date");
|
317
|
+
}
|
318
|
+
|
319
|
+
// NOTE: Here we relay in ActiveRecord (ActiveSupport) to get
|
320
|
+
// the date as a string in the database format.
|
321
|
+
statement.setDate(index, Date.valueOf(value.callMethod(context, "to_s", context.runtime.newSymbol("db")).toString()));
|
322
|
+
}
|
323
|
+
|
308
324
|
// Overrides the method in parent, we only remove the savepoint
|
309
325
|
// from the getSavepoints Map
|
310
326
|
@JRubyMethod(name = "release_savepoint", required = 1)
|
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.3.
|
4
|
+
version: 51.3.1
|
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-06-
|
11
|
+
date: 2019-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|