Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit f2c33604e19e8939bd45790e1afc643c9a783fb3 1 parent 4db74e0
@jeremyevans jeremyevans authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/sequel/database/query.rb
View
4 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
Please sign in to comment.
Something went wrong with that request. Please try again.