Skip to content

Commit

Permalink
Rails 2 now maps DECIMAL columns to Ruby BigDecimal values.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.ttiltd.com/svn/dev.rb/trunk/libraries/fb_adapter2@3555 e6efdd46-4312-0410-9032-dd8a18d5a4db
  • Loading branch information
brent committed Apr 4, 2008
1 parent 85a21ed commit a648c38
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions fb_adapter.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ require 'rubygems'
spec = Gem::Specification.new do |s|
s.author = "Brent Rowland"
s.name = "fb_adapter"
s.version = "0.5.5"
s.date = "2008-02-27"
s.version = "0.5.6"
s.date = "2008-04-04"
s.summary = "ActiveRecord Firebird Adapter"
s.requirements = "Firebird library fb"
s.require_path = 'lib'
Expand Down
16 changes: 9 additions & 7 deletions lib/active_record/connection_adapters/fb_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -218,13 +218,14 @@ def quote(value, column = nil) # :nodoc:
case value
when String
"@#{Base64.encode64(value).chop}@"
when Float, Fixnum, Bignum then quote_number(value)
when Date then quote_date(value)
when Time, DateTime then quote_timestamp(value)
when NilClass then "NULL"
when TrueClass then (column && column.type == :integer ? '1' : quoted_true)
when FalseClass then (column && column.type == :integer ? '0' : quoted_false)
else quote_object(value)
when Float, Fixnum,
Bignum, BigDecimal then quote_number(value)
when Date then quote_date(value)
when Time, DateTime then quote_timestamp(value)
when NilClass then "NULL"
when TrueClass then (column && column.type == :integer ? '1' : quoted_true)
when FalseClass then (column && column.type == :integer ? '0' : quoted_false)
else quote_object(value)
end
end

Expand Down Expand Up @@ -420,6 +421,7 @@ def native_database_types
:text => { :name => "blob sub_type text" },
:integer => { :name => "integer" },
:float => { :name => "float" },
:decimal => { :name => "decimal" },
:datetime => { :name => "timestamp" },
:timestamp => { :name => "timestamp" },
:time => { :name => "time" },
Expand Down

0 comments on commit a648c38

Please sign in to comment.