Title: [640] trunk/activerecord-jdbc/src/java/JdbcAdapterInternalService.java: Fix a small miss
- Revision
- 640
- Author
- olabini
- Date
- 2007-06-19 05:37:48 -0400 (Tue, 19 Jun 2007)
Log Message
Fix a small miss
Modified Paths
Diff
Modified: trunk/activerecord-jdbc/src/java/JdbcAdapterInternalService.java (639 => 640)
--- trunk/activerecord-jdbc/src/java/JdbcAdapterInternalService.java 2007-06-19 09:19:43 UTC (rev 639)
+++ trunk/activerecord-jdbc/src/java/JdbcAdapterInternalService.java 2007-06-19 09:37:48 UTC (rev 640)
@@ -658,16 +658,14 @@
case Types.TIME:
case Types.DATE:
java.sql.Date dt = null;
- if(value instanceof RubyString) {
+ if(!(value instanceof RubyTime)) {
try {
dt = new java.sql.Date(FORMAT.parse(value.toString()).getTime());
} catch(Exception e) {
dt = java.sql.Date.valueOf(value.toString());
}
- } else if(value instanceof RubyTime) {
- dt = new java.sql.Date(((RubyTime)value).getJavaDate().getTime());
} else {
- throw new RuntimeException("can't handle value of type " + ((RubyObject)value).type() + " for type " + type);
+ dt = new java.sql.Date(((RubyTime)value).getJavaDate().getTime());
}
ps.setDate(index, dt);
break;
_______________________________________________
Jruby-extras-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/jruby-extras-devel