Permalink
Browse files

Recognize decimal(10, false) and decimal(10, true) as decimal types

The db2 adapter needs this for decimal types to be returned
as :decimal.
  • Loading branch information...
1 parent 4db74e0 commit f2c33604e19e8939bd45790e1afc643c9a783fb3 @jeremyevans jeremyevans committed Oct 15, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/sequel/database/query.rb
@@ -514,8 +514,8 @@ def schema_column_type(db_type)
:boolean
when /\A(real|float|double( precision)?)\z/io
:float
- when /\A(?:(?:(?:num(?:ber|eric)?|decimal)(?:\(\d+,\s*(\d+)\))?)|(?:small)?money)\z/io
- $1 && $1 == '0' ? :integer : :decimal
+ when /\A(?:(?:(?:num(?:ber|eric)?|decimal)(?:\(\d+,\s*(\d+|false|true)\))?)|(?:small)?money)\z/io
+ $1 && ['0', 'false'].include?($1) ? :integer : :decimal
when /bytea|[bc]lob|image|(var)?binary/io
:blob
when /\Aenum/io

0 comments on commit f2c3360

Please sign in to comment.