Title: [513] trunk/activerecord-jdbc/lib/jdbc_adapter/jdbc_derby.rb: handle booleans in Derby better
Revision
513
Author
olabini
Date
2007-04-26 17:59:04 -0400 (Thu, 26 Apr 2007)

Log Message

handle booleans in Derby better

Modified Paths


Diff

Modified: trunk/activerecord-jdbc/lib/jdbc_adapter/jdbc_derby.rb (512 => 513)


--- trunk/activerecord-jdbc/lib/jdbc_adapter/jdbc_derby.rb	2007-04-26 21:27:39 UTC (rev 512)
+++ trunk/activerecord-jdbc/lib/jdbc_adapter/jdbc_derby.rb	2007-04-26 21:59:04 UTC (rev 513)
@@ -34,6 +34,11 @@
         (value.hour == 0 and value.min == 0 and value.sec == 0) ?
         Date.new(value.year, value.month, value.day) : value
       end
+
+      def simplified_type(field_type)
+        return :boolean if field_type =~ /smallint/i 
+        super
+      end
     end
 
     include JdbcSpec::MissingFunctionalityHelper
@@ -41,6 +46,7 @@
     def modify_types(tp)
       tp[:primary_key] = "int generated by default as identity NOT NULL PRIMARY KEY"
       tp[:integer][:limit] = nil
+      tp[:boolean] = {:name => "smallint"}
       tp
     end
 
_______________________________________________
Jruby-extras-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/jruby-extras-devel

Reply via email to